78 lines
2.6 KiB
C#
78 lines
2.6 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace VOL.Core.Migrations
|
|
{
|
|
public partial class init058 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_G_EntryStudent_G_Activities_G_ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_G_EntryStudent_G_ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "G_ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "活动Id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_G_EntryStudent_ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
column: "ActivitiesId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_G_EntryStudent_G_Activities_ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
column: "ActivitiesId",
|
|
principalTable: "G_Activities",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_G_EntryStudent_G_Activities_ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_G_EntryStudent_ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ActivitiesId",
|
|
table: "G_EntryStudent");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "G_ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_G_EntryStudent_G_ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
column: "G_ActivitiesId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_G_EntryStudent_G_Activities_G_ActivitiesId",
|
|
table: "G_EntryStudent",
|
|
column: "G_ActivitiesId",
|
|
principalTable: "G_Activities",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
} |