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

[Question] dnx ef migrations add #4166

Closed
ghost opened this issue Dec 23, 2015 · 1 comment
Closed

[Question] dnx ef migrations add #4166

ghost opened this issue Dec 23, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 23, 2015

Hi Guys,

Something weird in the migrations?
I create my domain, and I add dnx ef migrations add v0.0.1, and perform dnx ef database update. this step is successfully.
without modify my domain properties, I do perform dnx ef migrations add v0.0.2, it will generate another script and this time it create this below.

    protected override void Up(MigrationBuilder migrationBuilder)
    {
        migrationBuilder.DropForeignKey(name: "FK_JobPost_User_UserId", table: "JobPost");
        migrationBuilder.DropForeignKey(name: "FK_JobPostUser_JobPost_JobPostId", table: "JobPostUser");
        migrationBuilder.AddForeignKey(
            name: "FK_JobPost_User_UserId",
            table: "JobPost",
            column: "UserId",
            principalTable: "User",
            principalColumn: "Id",
            onDelete: ReferentialAction.Cascade);
        migrationBuilder.AddForeignKey(
            name: "FK_JobPostUser_JobPost_JobPostId",
            table: "JobPostUser",
            column: "JobPostId",
            principalTable: "JobPost",
            principalColumn: "Id",
            onDelete: ReferentialAction.Cascade);
    }

Why this code is not generating on the first migrations?
Is this a bug or ?

@techyian
Copy link

@smitpatel informed me this is a dupe of #3751 when I raised a similar query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants