Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations create dbo.DefaultSequence when named schema is specified #1919

Closed
rmja opened this issue Mar 27, 2015 · 2 comments
Closed

Migrations create dbo.DefaultSequence when named schema is specified #1919

rmja opened this issue Mar 27, 2015 · 2 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@rmja
Copy link

rmja commented Mar 27, 2015

I am using multiple schemas in the database, and I have a DbContext for each of them.
In OnModelCreating() I have for example the following:

modelBuilder.ForRelational().Sequence("DefaultSequence", "accounting");

When I run dnx . ef migration add Initial, the migration code has (for Up()):

migrationBuilder.CreateSequence("DefaultSequence", "accounting", storeType: "bigint");
migrationBuilder.CreateSequence("DefaultSequence", storeType: "bigint");

This of cause fails when having independent migrations for each of the schemas, as dbo.DefaultSequence can only exist once in the database.
As far as I can tell, the dbo.DefaultSequence should not be created when a named schema is specified.

@bricelam
Copy link
Contributor

It looks like this is a bug in the workaround I have in Migrations for #1568. We could either fix the workaround, or just fix the original issue.

For now, @rmja, you can just remove the second call to CreateSequence() in your migration.

@rmja
Copy link
Author

rmja commented Mar 27, 2015

@brycelam Yes I found that and it works fine, thanks.

@rowanmiller rowanmiller added this to the 7.0.0 milestone Mar 30, 2015
@bricelam bricelam modified the milestones: 7.0.0-beta5, 7.0.0 May 26, 2015
@bricelam bricelam modified the milestones: 7.0.0-beta6, 7.0.0-beta5 May 28, 2015
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers modified the milestones: 1.0.0-beta6, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants