|
- using Microsoft.EntityFrameworkCore.Migrations;
-
- #nullable disable
-
- namespace EF_Code_First.Migrations
- {
- public partial class V02 : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Students_Grade_GradeId",
- table: "Students");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_Grade",
- table: "Grade");
-
- migrationBuilder.RenameTable(
- name: "Grade",
- newName: "Grades");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_Grades",
- table: "Grades",
- column: "GradeId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Students_Grades_GradeId",
- table: "Students",
- column: "GradeId",
- principalTable: "Grades",
- principalColumn: "GradeId",
- onDelete: ReferentialAction.Cascade);
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_Students_Grades_GradeId",
- table: "Students");
-
- migrationBuilder.DropPrimaryKey(
- name: "PK_Grades",
- table: "Grades");
-
- migrationBuilder.RenameTable(
- name: "Grades",
- newName: "Grade");
-
- migrationBuilder.AddPrimaryKey(
- name: "PK_Grade",
- table: "Grade",
- column: "GradeId");
-
- migrationBuilder.AddForeignKey(
- name: "FK_Students_Grade_GradeId",
- table: "Students",
- column: "GradeId",
- principalTable: "Grade",
- principalColumn: "GradeId");
- }
- }
- }
|