Skip to content

Add suppressTransactions optional flag to DbContext.Database.Migrate methods #30881

Closed as not planned

Description

A while ago the default migration script generation behavior was changed to always wrap the migration code inside a transaction.
It can be changed when running the migrations through the command console or package manager console and passing the --no-transactions option.
It can not be changed when calling the DbContext.Database.MigrateAsync. There's no parameter to tell the Migrate method to not use transactions.

I'm using YugabyteDB which doesn't support DDL code inside transactions.
I like to have a DatabaseMigrator application which is run during CI/CD to create, migrate and seed all our databases.

Could we add an optional bool parameter (e.g. suppressTransactions) to the DbContext.Database.MigrateAsync and DbContext.Database.Migrate methods, which when set would mean that the generated migration code will not contain transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions