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:
Branch for feature
Write a SQL script to migrate the database (i.e create a table, add a new column etc)
Merge the branch
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.
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:
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/