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: Support database schemas #948

Closed
anpete opened this issue Oct 23, 2014 · 5 comments
Closed

Migrations: Support database schemas #948

anpete opened this issue Oct 23, 2014 · 5 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@anpete
Copy link
Contributor

anpete commented Oct 23, 2014

Created a relational model and tried to used a custom, non-existent db schema. Database creation failed because it looks like migrations has no support for creating database schemas.

@rowanmiller rowanmiller assigned ghost Oct 27, 2014
@rowanmiller rowanmiller added this to the 1.0.0-beta2 milestone Oct 27, 2014
@rowanmiller rowanmiller modified the milestones: 7.0.0-beta2, 7.0.0 Nov 25, 2014
@ghost
Copy link

ghost commented Nov 27, 2014

commit e3a3901

@ghost ghost closed this as completed Nov 27, 2014
@ghost ghost removed their assignment Nov 27, 2014
@bricelam
Copy link
Contributor

bricelam commented Feb 9, 2015

Re-opening. I've regressed this.

@bricelam bricelam reopened this Feb 9, 2015
@bricelam bricelam removed this from the 7.0.0 milestone Feb 9, 2015
@rowanmiller rowanmiller changed the title Migrations: Database schemas not supported Migrations: Support database schemas Feb 11, 2015
@rowanmiller rowanmiller added this to the 7.0.0 milestone Feb 11, 2015
@rowanmiller
Copy link
Contributor

When you work on this the ModelDiffer currently throws if you add a schema since it tries to create an operation to move from an unspecified (and therefore null) schema.

System.ArgumentNullException: Value cannot be null.
Parameter name: newSchema
at Microsoft.Data.Entity.Utilities.Check.NotEmpty(String value, String parameterName)
at Microsoft.Data.Entity.Relational.Migrations.Operations.MoveTableOperation..ctor(String name, String schema, String newSchema, IReadOnlyDictionary`2 annotations)
at Microsoft.Data.Entity.Relational.Migrations.Infrastructure.ModelDiffer.d__15.MoveNext()

@bricelam
Copy link
Contributor

Notes from today's design meeting:

  • When a new schema is encountered in the model differ, we'll scaffold a CreateSchema operation
  • CreateSchema will create the schema if it doesn't already exists
  • We'll never scaffold DropSchema, but it can manually be added to the migration

@bricelam bricelam modified the milestones: 7.0.0-beta6, 7.0.0 Jul 1, 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-enhancement
Projects
None yet
Development

No branches or pull requests

5 participants