You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know you can use EnsureDatabase.For.SqlDatabase() to get DbUp to create a database if it doesn't exist, but I'd rather script it myself (along with the initial config changes to the database). In order to have a truly full history of DB transitions, there should be a special-case initial one that actually creates the DB.
I think DbUp needs to have a feature added to it to allow this because right now if you connect to the DBMS in order to create the DB you'll have to avoid specifying an initial catalog. As such, DbUp will create the SchemaVersions table in the master DB instead of in the one you've newly-created in the initial update script.
Perhaps DbUp could have a config setting allowing the first script to switch to a newly-created DB after the update is run, and only then create the SchemaVersions table?
The text was updated successfully, but these errors were encountered:
I've made a pull request with my proposed fix for this - allow an optional set of create database SQL statements to be passed into EnsureDatabase.For.SqlDatabase() and used instead of the one that's generated by DbUp. I also added the ability to check whether the DB would be created, in case the calling code wants to merely check whether a DB would be created without creating it (a 'validate migrations' kind of mode).
I know you can use
EnsureDatabase.For.SqlDatabase()
to get DbUp to create a database if it doesn't exist, but I'd rather script it myself (along with the initial config changes to the database). In order to have a truly full history of DB transitions, there should be a special-case initial one that actually creates the DB.I think DbUp needs to have a feature added to it to allow this because right now if you connect to the DBMS in order to create the DB you'll have to avoid specifying an initial catalog. As such, DbUp will create the SchemaVersions table in the
master
DB instead of in the one you've newly-created in the initial update script.Perhaps DbUp could have a config setting allowing the first script to switch to a newly-created DB after the update is run, and only then create the SchemaVersions table?
The text was updated successfully, but these errors were encountered: