118 lines
5.3 KiB
C#
118 lines
5.3 KiB
C#
|
|
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
namespace APT.Data.Migrations.Migrations
|
|||
|
|
{
|
|||
|
|
public partial class wyw2026020901 : Migration
|
|||
|
|
{
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.AddColumn<Guid>(
|
|||
|
|
name: "T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateTable(
|
|||
|
|
name: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
columns: table => new
|
|||
|
|
{
|
|||
|
|
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|||
|
|
SURVEY_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|||
|
|
USER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|||
|
|
DEPARTMENT_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|||
|
|
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
|
|||
|
|
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|||
|
|
ENTITY_ORG_TPYE = table.Column<int>(type: "int", nullable: false),
|
|||
|
|
FORM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|||
|
|
FLOW_STATUS = table.Column<int>(type: "int", nullable: false),
|
|||
|
|
FLOW_SEND_STATUS = table.Column<int>(type: "int", nullable: false),
|
|||
|
|
FLOW_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|||
|
|
CREATE_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|||
|
|
MODIFY_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|||
|
|
CREATER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|||
|
|
MODIFIER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|||
|
|
},
|
|||
|
|
constraints: table =>
|
|||
|
|
{
|
|||
|
|
table.PrimaryKey("PK_T_SE_SAFE_SURVEY_USER", x => x.ID);
|
|||
|
|
table.ForeignKey(
|
|||
|
|
name: "FK_T_SE_SAFE_SURVEY_USER_T_FM_DEPARTMENT_DEPARTMENT_ID",
|
|||
|
|
column: x => x.DEPARTMENT_ID,
|
|||
|
|
principalTable: "T_FM_DEPARTMENT",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
table.ForeignKey(
|
|||
|
|
name: "FK_T_SE_SAFE_SURVEY_USER_T_FM_ORGANIZATION_ORG_ID",
|
|||
|
|
column: x => x.ORG_ID,
|
|||
|
|
principalTable: "T_FM_ORGANIZATION",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
table.ForeignKey(
|
|||
|
|
name: "FK_T_SE_SAFE_SURVEY_USER_T_FM_USER_USER_ID",
|
|||
|
|
column: x => x.USER_ID,
|
|||
|
|
principalTable: "T_FM_USER",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
table.ForeignKey(
|
|||
|
|
name: "FK_T_SE_SAFE_SURVEY_USER_T_SE_SAFE_SURVEY_SURVEY_ID",
|
|||
|
|
column: x => x.SURVEY_ID,
|
|||
|
|
principalTable: "T_SE_SAFE_SURVEY",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_PF_PARAM_T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM",
|
|||
|
|
column: "T_SE_SAFE_SURVEY_USERID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_SE_SAFE_SURVEY_USER_DEPARTMENT_ID",
|
|||
|
|
table: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
column: "DEPARTMENT_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_SE_SAFE_SURVEY_USER_ORG_ID",
|
|||
|
|
table: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
column: "ORG_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_SE_SAFE_SURVEY_USER_SURVEY_ID",
|
|||
|
|
table: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
column: "SURVEY_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_SE_SAFE_SURVEY_USER_USER_ID",
|
|||
|
|
table: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
column: "USER_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_T_PF_PARAM_T_SE_SAFE_SURVEY_USER_T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM",
|
|||
|
|
column: "T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
principalTable: "T_SE_SAFE_SURVEY_USER",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_T_PF_PARAM_T_SE_SAFE_SURVEY_USER_T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropTable(
|
|||
|
|
name: "T_SE_SAFE_SURVEY_USER");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_T_PF_PARAM_T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "T_SE_SAFE_SURVEY_USERID",
|
|||
|
|
table: "T_PF_PARAM");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|