Skip to content

DbUp should allow a special-case initial transition to create a database #16

@jez9999

Description

@jez9999

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions