using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace data.Migrations
{
///
public partial class Fix : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "StudentId",
table: "StudentGroupsSubjects",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateIndex(
name: "IX_StudentGroupsSubjects_StudentId",
table: "StudentGroupsSubjects",
column: "StudentId");
migrationBuilder.AddForeignKey(
name: "FK_StudentGroupsSubjects_Students_StudentId",
table: "StudentGroupsSubjects",
column: "StudentId",
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_StudentGroupsSubjects_Students_StudentId",
table: "StudentGroupsSubjects");
migrationBuilder.DropIndex(
name: "IX_StudentGroupsSubjects_StudentId",
table: "StudentGroupsSubjects");
migrationBuilder.DropColumn(
name: "StudentId",
table: "StudentGroupsSubjects");
}
}
}