{"repo":"intelligenthack/badgie-migrator","free":true,"listed":false,"github":"https://github.com/intelligenthack/badgie-migrator","clone":"git clone https://github.com/intelligenthack/badgie-migrator.git","description":"A SQL migration tool for many databases","language":"C#","stars":13,"topics":["postgresql","sql-server","database","database-migrations","migration","migrations","mysql","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"A SQL migration tool originally built for Badgie What are database migrations? As you develop new versions of a server application which you want to deploy with no downtime, you'll need to write snippets of SQL that change the schema from the current version to the next, so they can be run on all the systems (production, staging, development...) in the same way. If these migrations are the only schema-changing operations on the database, this gives you a good guarantee that all the schemas remain in sync. How are migrations used? Usually there's a build step that runs migrations. This in general should happen before running the application or running tests. It is a convention that we first alter the database in a backwards compatible way and then we deploy the new version of the application that takes advantage of the new schema version Are migrations safe? In order to make migrations safe there are a few preconditions to know about. 1. each migration should have a guard , i.e. an IF statement that only runs the migration if the schema is in the right state. For example you might want to only add a certain table if the table is not present. 2. each migration should therefore be idempotent : if you run it twice, it should only change the schema once 3. migrations should be immutable 4. migrations should either add or delete database entities, and avoid altering existing ones. Adding a column is fine, altering it can be problematic, renaming it is likely not a good idea at all.","default_branch":null,"files":null,"tree":[],"storefront":"/r/intelligenthack","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/intelligenthack/badgie-migrator/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}