Database migration utility using DBUp
- Replace .sql files in Scripts folder
- Add variables to dictionary in
.WithVariables()
statement - Update connection string in appsettings.json
- Run without parameters to perform database migration
- Options:
- --dry-run : run without performing actual database migration to check for errors
- --output : output migration script to file
- Default target database is SQL Server. Replace
dbup-sqlserver.dll
withdbup-postgresql.dll
,dbup-mysql.dll
,dbup-oracle.dll
, etc. from nuget based on target database - Views, Functions and StoredProcedures are dropped and re-created with every migration. Update
ScriptType
toRunOnce
on lines starting with.WithScriptsEmbeddedInAssembly()
if execution plan or stats are important for such objects