113 lines
3.8 KiB
C#
113 lines
3.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class UserModify : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_TaskInstance_TaskStudy_StudyId",
|
|
table: "TaskInstance");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "IdentityUserId",
|
|
table: "UserPassWordLog",
|
|
type: "uniqueidentifier",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "IdentityUserId",
|
|
table: "User",
|
|
type: "uniqueidentifier",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "IsMutiAccountInfoConfirm",
|
|
table: "User",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false,
|
|
comment: "多账号信息是否已经确认");
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "IsUserRoleDisabled",
|
|
table: "User",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance",
|
|
column: "StudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_TaskInstance_TaskStudy_StudyId",
|
|
table: "TaskInstance",
|
|
column: "StudyId",
|
|
principalTable: "TaskStudy",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_TaskInstance_TaskStudy_StudyId",
|
|
table: "TaskInstance");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IdentityUserId",
|
|
table: "UserPassWordLog");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IdentityUserId",
|
|
table: "User");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IsMutiAccountInfoConfirm",
|
|
table: "User");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IsUserRoleDisabled",
|
|
table: "User");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance",
|
|
column: "StudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "SeqId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_TaskInstance_TaskStudy_StudyId",
|
|
table: "TaskInstance",
|
|
column: "StudyId",
|
|
principalTable: "TaskStudy",
|
|
principalColumn: "SeqId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|