84 lines
2.5 KiB
C#
84 lines
2.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MysqlMigrations.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class RemoveUnusedRef : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Faculty_Campus_CampusId",
|
|
table: "Faculty");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Faculty_CampusId",
|
|
table: "Faculty");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CampusId",
|
|
table: "Faculty");
|
|
|
|
migrationBuilder.AlterColumn<bool>(
|
|
name: "IsExcludedWeeks",
|
|
table: "Lesson",
|
|
type: "BOOLEAN(1)",
|
|
nullable: true,
|
|
oldClrType: typeof(ulong),
|
|
oldType: "BIT(1)",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<bool>(
|
|
name: "IsEven",
|
|
table: "Lesson",
|
|
type: "BOOLEAN(1)",
|
|
nullable: false,
|
|
oldClrType: typeof(ulong),
|
|
oldType: "BIT(1)");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<ulong>(
|
|
name: "IsExcludedWeeks",
|
|
table: "Lesson",
|
|
type: "BIT(1)",
|
|
nullable: true,
|
|
oldClrType: typeof(bool),
|
|
oldType: "BOOLEAN(1)",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AlterColumn<ulong>(
|
|
name: "IsEven",
|
|
table: "Lesson",
|
|
type: "BIT(1)",
|
|
nullable: false,
|
|
oldClrType: typeof(bool),
|
|
oldType: "BOOLEAN(1)");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "CampusId",
|
|
table: "Faculty",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Faculty_CampusId",
|
|
table: "Faculty",
|
|
column: "CampusId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Faculty_Campus_CampusId",
|
|
table: "Faculty",
|
|
column: "CampusId",
|
|
principalTable: "Campus",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
}
|
|
}
|
|
}
|