irc-netcore-api/IRaCIS.Core.Infra.EFCore/Migrations/20241106071417_UserSoftDele...

71 lines
2.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class UserSoftDelete : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<Guid>(
name: "OptUserId",
table: "UserLog",
type: "uniqueidentifier",
nullable: true,
comment: "被操作的人,自己操作的就是自己",
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DeleteUserId",
table: "User",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "DeletedTime",
table: "User",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "User",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DeleteUserId",
table: "User");
migrationBuilder.DropColumn(
name: "DeletedTime",
table: "User");
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "User");
migrationBuilder.AlterColumn<Guid>(
name: "OptUserId",
table: "UserLog",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true,
oldComment: "被操作的人,自己操作的就是自己");
}
}
}