mh_custom/wtmProject.DataAccess/Migrations/20240327010911_hmr2024032701.cs

65 lines
2.9 KiB
C#
Raw Normal View History

2024-05-16 17:30:33 +08:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace wtmProject.DataAccess.Migrations
{
public partial class hmr2024032701 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "WTM_USER");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "WTM_USER",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
PhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CellPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
Code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
Gender = table.Column<int>(type: "int", nullable: true),
IsValid = table.Column<bool>(type: "bit", nullable: false),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Password = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_WTM_USER", x => x.ID);
table.ForeignKey(
name: "FK_WTM_USER_FileAttachments_PhotoId",
column: x => x.PhotoId,
principalTable: "FileAttachments",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_WTM_USER_FrameworkGroups_DepartmentId",
column: x => x.DepartmentId,
principalTable: "FrameworkGroups",
principalColumn: "ID");
});
migrationBuilder.CreateIndex(
name: "IX_WTM_USER_DepartmentId",
table: "WTM_USER",
column: "DepartmentId");
migrationBuilder.CreateIndex(
name: "IX_WTM_USER_PhotoId",
table: "WTM_USER",
column: "PhotoId");
}
}
}