mh_custom/wtmProject.DataAccess/Migrations/20240312093524_hmr2024031202.cs

116 lines
5.8 KiB
C#
Raw Permalink 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 hmr2024031202 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FrameworkCustoms",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CustomCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
CustomName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkCustoms", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkProjects",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ProjectCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
ProjectName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkProjects", x => x.ID);
});
migrationBuilder.CreateTable(
name: "FrameworkOutRecords",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
City = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
OutStartTime = table.Column<DateTime>(type: "datetime2", nullable: true),
OutEndTime = table.Column<DateTime>(type: "datetime2", nullable: true),
OutRecordType = table.Column<int>(type: "int", nullable: true),
CustomId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
ProjectId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FrameworkOutRecords", x => x.ID);
table.ForeignKey(
name: "FK_FrameworkOutRecords_FrameworkCustoms_CustomId",
column: x => x.CustomId,
principalTable: "FrameworkCustoms",
principalColumn: "ID");
table.ForeignKey(
name: "FK_FrameworkOutRecords_FrameworkProjects_ProjectId",
column: x => x.ProjectId,
principalTable: "FrameworkProjects",
principalColumn: "ID");
table.ForeignKey(
name: "FK_FrameworkOutRecords_FrameworkUsers_UserId",
column: x => x.UserId,
principalTable: "FrameworkUsers",
principalColumn: "ID");
});
migrationBuilder.CreateIndex(
name: "IX_FrameworkOutRecords_CustomId",
table: "FrameworkOutRecords",
column: "CustomId");
migrationBuilder.CreateIndex(
name: "IX_FrameworkOutRecords_ProjectId",
table: "FrameworkOutRecords",
column: "ProjectId");
migrationBuilder.CreateIndex(
name: "IX_FrameworkOutRecords_UserId",
table: "FrameworkOutRecords",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FrameworkOutRecords");
migrationBuilder.DropTable(
name: "FrameworkCustoms");
migrationBuilder.DropTable(
name: "FrameworkProjects");
}
}
}