Subterfuge-Revived / Remake-Backend

Server side validation and API
Creative Commons Zero v1.0 Universal
10 stars 1 forks source link

Database Migration #4

Closed QuinnBast closed 4 years ago

QuinnBast commented 4 years ago

Created by @mike-eason: The database schema needs to be in a state where we can make small iterative changes. Ideally this means that if a developer was to make a change to the schema, this will not require a full sql dump.

One approach would be to implement DB Up. So changes to the database will be like so:

  1. Branch for feature
  2. Write a SQL script to migrate the database (i.e create a table, add a new column etc)
  3. Merge the branch
  4. CI/CD executes the script against the database

We will need a utility application that will execute the db migration scripts on a given database.

Here's an example of a tool I have used in the past for migrating MSSQL databases: https://dbup.readthedocs.io/en/latest/philosophy-behind-dbup/

QuinnBast commented 4 years ago

Resolved in #10