109 lines
5.0 KiB
C#
109 lines
5.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace APT.Data.Migrations.Migrations
|
|
{
|
|
public partial class wyw2025121903 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "T_SE_NEW_USER_DETAIL_TEXT",
|
|
columns: table => new
|
|
{
|
|
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
RECORD_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
USER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
SCORE = table.Column<int>(type: "int", nullable: true),
|
|
TEXT_TIMES = table.Column<int>(type: "int", nullable: false),
|
|
ISPASS = table.Column<bool>(type: "bit", nullable: false),
|
|
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
|
|
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
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_NEW_USER_DETAIL_TEXT", x => x.ID);
|
|
table.ForeignKey(
|
|
name: "FK_T_SE_NEW_USER_DETAIL_TEXT_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_NEW_USER_DETAIL_TEXT_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_NEW_USER_DETAIL_TEXT_T_SE_NEW_USER_DETAIL_RECORD_ID",
|
|
column: x => x.RECORD_ID,
|
|
principalTable: "T_SE_NEW_USER_DETAIL",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_T_SE_NEW_USER_DETAIL_PAPER_TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER",
|
|
column: "TEXT_ID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_T_SE_NEW_USER_DETAIL_TEXT_ORG_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_TEXT",
|
|
column: "ORG_ID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_T_SE_NEW_USER_DETAIL_TEXT_RECORD_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_TEXT",
|
|
column: "RECORD_ID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_T_SE_NEW_USER_DETAIL_TEXT_USER_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_TEXT",
|
|
column: "USER_ID");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_T_SE_NEW_USER_DETAIL_PAPER_T_SE_NEW_USER_DETAIL_TEXT_TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER",
|
|
column: "TEXT_ID",
|
|
principalTable: "T_SE_NEW_USER_DETAIL_TEXT",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_T_SE_NEW_USER_DETAIL_PAPER_T_SE_NEW_USER_DETAIL_TEXT_TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "T_SE_NEW_USER_DETAIL_TEXT");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_T_SE_NEW_USER_DETAIL_PAPER_TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TEXT_ID",
|
|
table: "T_SE_NEW_USER_DETAIL_PAPER");
|
|
}
|
|
}
|
|
}
|