Author: Anian Ziegler Language: text
Description: A question about database migrations Timestamp: 2017-08-15 21:48:06 +0000
View raw paste Reply
  1. Hello Dan and Wes,
  3. First up I have to say I really like your show and in fact I'm listening to nearly all JB Shows on a daily basis. I've learned a lot about Linux, security and the OpenSource world. So thank you very much for all the work you are doing.
  5. Now to my question:
  7. I'm building web applications with PostgreSQL as a database in the backend. From one of my previous project I had learned about so called database migrations in the Laravel Schema builder ( Luckily I don't have to use PHP any more and found a similar solution for NodeJS ( The basic idea is, that you provide the changes you want to make to the database schema in JavaScript using a query builder. These changes are then translated into proper SQL statements for postgres or MySql and applied to the database. Each set of changes is described in a separate file with a time stamp attached to it and you also provide queries for rolling back the changes you described. So it's somewhat like a version control for your database.
  9. I really like the tools knex provides me with but I would love to have some more features like getting a description of the current schema or even a diff between two migrations. Do you know of any tools that do something like that? Do you keep a database structure under version control and how would you do that?
  11. Because I'm only using postgres I wouldn't mind losing the compatibility to other database formats like MySql. But until now I haven't found any simple tools, would allow for easily developing and deploying my database schema step by step. It would be awesome to here your take on that.
  13. Greetings and all the best for the future from Germany,
View raw paste Reply