11

In my model I have navigation property Language:

public class IntegratorDescription : BaseContract
{
    [Key, Column(TypeName = "bigint"), DataMember]
    public long Id { get; set; }
    [DataMember, Column(TypeName = "bigint"), ForeignKey("Language")]
    public long LangId { get; set; }
    [DataMember]
    public string CompanyShortInfo { get; set; }
    [DataMember, Column(TypeName = "ntext")]
    public string CompanyInfo { get; set; }

    public virtual Models.Language Language { get; set; }
}

Language table already exists and it's done by another ORM, I need to say Migrations not to try to create Language table but update only Description table. How?

-"There is already an object named 'Languages' in the database."

1 Answer 1

13

-IGNORECHANGES

Scaffolds an empty migration ignoring any pending changes detected in the current model. This can be used to create an initial, empty migration to enable Migrations for an existing database. N.B. Doing this assumes that the target database schema is compatible with the current model.

http://coding.abel.nu/2012/03/ef-migrations-command-reference/

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

2 Comments

Isn't there a way to have it create the table if it doesn't exist, and ignore the table if it does? This seems like a huge oversight in EF to me.
i would hope ^ to be true but this post got me past my issue! TY

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.