4 ms·
.NET/MSSQL shop here: Our source controlled files contain the database definition: - a dacpac file generated by SSDT for the schema - sql scripts for seed da
by Guillaume86 7y ago
.NET/MSSQL shop here:
Our source controlled files contain the database definition:
- a dacpac file generated by SSDT for the schema
- sql scripts for seed data (which changes a lot in our case), generated by a custom CLI tool (uses bcp.exe).
We have a "dev" database that is basically the "master".
We have a CLI tool to generate the database definition files from the dev database.
When someone make/need changes in the database, he makes them in the dev DB then call the CLI tool to update the source files.
When publishing a version the dacpac and data script are included.
Migrations are created on demand (no need to go through each version, skipping versions is common).
Our migration tool create reference databases of the source and target versions, then generate a schema diff script with SSDT and a data diff script with ApexSQL Data Compare.
We can review/editthe migrations scripts before applying migrations.
It works well enough that we run automated migrations at night (with backup before/restore after in case of issue).