3

I'm running Entity Freamework Code First Migrations. When trying to run the application I get the error: A column ID occurred more than once in the specification. I have AutomaticMigrationsEnabled set to true in the configuration because when I run the project, I want the migrations to run automatically.

This is the verbose results when I tried running it through the package manager:

Applying code-based migration: 201211261626569_AddActiveFlagForProjects.

ALTER TABLE [Projects] ADD [Active] [bit] NOT NULL DEFAULT 1

[Inserting migration history record] Applying automatic migration: 201211261901371_AutomaticMigration.

ALTER TABLE [Projects] ADD [Active] [bit] NOT NULL DEFAULT 0

Why is EF trying to alter the projects table twice?

I'm using Entity Framework 5.0 and SQL CE 4.0.

1
  • any chance of seeing the project class and any classes it may be related to? It seems you are adding this property. Is that correct? Commented Nov 28, 2012 at 16:46

1 Answer 1

3

Adding -IgnoreChanges flag to Add-Migration

http://entityframework.codeplex.com/workitem/652

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.