118 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			118 lines
		
	
	
		
			6.1 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using Microsoft.EntityFrameworkCore.Migrations;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace APT.Data.Migrations.Migrations
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class wyw2025092301 : Migration
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        protected override void Up(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_PF_NOTICE",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    TITLE = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true),
							 | 
						|||
| 
								 | 
							
								                    CONTENT = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
							 | 
						|||
| 
								 | 
							
								                    CREATE_NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
							 | 
						|||
| 
								 | 
							
								                    CREATE_DEPARTMENT = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
							 | 
						|||
| 
								 | 
							
								                    DEPARTMENT_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
							 | 
						|||
| 
								 | 
							
								                    ISHEAD = table.Column<bool>(type: "bit", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    ISTOCHILE = 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_PF_NOTICE", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_PF_NOTICE_T_FM_ORGANIZATION_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.ORG_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_FM_ORGANIZATION",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_PF_NOTICE_FILE",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    NOTICE_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    IMG_FILE_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: 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_PF_NOTICE_FILE", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_PF_NOTICE_FILE_T_FM_ORGANIZATION_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.ORG_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_FM_ORGANIZATION",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_PF_NOTICE_FILE_T_PF_IMG_FILE_IMG_FILE_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.IMG_FILE_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_PF_IMG_FILE",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_PF_NOTICE_FILE_T_PF_NOTICE_NOTICE_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.NOTICE_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_PF_NOTICE",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_PF_NOTICE_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_PF_NOTICE",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_PF_NOTICE_FILE_IMG_FILE_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_PF_NOTICE_FILE",
							 | 
						|||
| 
								 | 
							
								                column: "IMG_FILE_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_PF_NOTICE_FILE_NOTICE_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_PF_NOTICE_FILE",
							 | 
						|||
| 
								 | 
							
								                column: "NOTICE_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_PF_NOTICE_FILE_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_PF_NOTICE_FILE",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        protected override void Down(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_PF_NOTICE_FILE");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_PF_NOTICE");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |