123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- namespace Ropin.Inspection.Model.Migrations
- {
- public partial class EditPNT : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "TPNT_Area",
- columns: table => new
- {
- C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
- C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
- C_SName = table.Column<string>(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true),
- C_ImageUrl = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true),
- I_Sort = table.Column<int>(type: "int", nullable: false),
- C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
- C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
- D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
- C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
- D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
- C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TPNT_Area", x => x.C_Code);
- table.ForeignKey(
- name: "FK_TPNT_Area_TSYS_User_C_CreateBy",
- column: x => x.C_CreateBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TPNT_Area_TSYS_User_C_LastUpdatedBy",
- column: x => x.C_LastUpdatedBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "TPNT_Store",
- columns: table => new
- {
- C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
- C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_AreaCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
- C_Code = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_Name = table.Column<string>(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false),
- C_SName = table.Column<string>(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true),
- C_TypeCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_Address = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
- C_GPS = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true),
- I_Sort = table.Column<int>(type: "int", nullable: false),
- C_Remark = table.Column<string>(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true),
- C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
- D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
- C_LastUpdatedBy = table.Column<Guid>(type: "char(36)", nullable: true),
- D_LastUpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: true),
- C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TPNT_Store", x => x.C_ID);
- table.ForeignKey(
- name: "FK_TPNT_Store_TBDM_Area_C_AreaCode",
- column: x => x.C_AreaCode,
- principalTable: "TBDM_Area",
- principalColumn: "C_Code",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TPNT_Store_TSYS_User_C_CreateBy",
- column: x => x.C_CreateBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TPNT_Store_TSYS_User_C_LastUpdatedBy",
- column: x => x.C_LastUpdatedBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- //table.ForeignKey(
- // name: "FK_TSYS_LicenseTPNT_Store_Code",
- // column: x => x.C_LicenseCode,
- // principalTable: "TSYS_License",
- // principalColumn: "C_Code",
- // onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "TPNT_StoreOrg",
- columns: table => new
- {
- C_StoreCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_OrgCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_CreateBy = table.Column<Guid>(type: "char(36)", nullable: false),
- D_CreateOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TPNT_StoreOrg", x => new { x.C_StoreCode, x.C_OrgCode });
- table.ForeignKey(
- name: "FK_TPNT_StoreOrg_TSYS_User_C_CreateBy",
- column: x => x.C_CreateBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "TPNT_Type",
- columns: table => new
- {
- C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
- C_Name = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- I_Sort = table.Column<int>(type: "int", nullable: false),
- C_Status = table.Column<string>(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TPNT_Type", x => x.C_Code);
- });
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_Area_C_CreateBy",
- table: "TPNT_Area",
- column: "C_CreateBy");
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_Area_C_LastUpdatedBy",
- table: "TPNT_Area",
- column: "C_LastUpdatedBy");
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_Store_C_AreaCode",
- table: "TPNT_Store",
- column: "C_AreaCode");
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_Store_C_CreateBy",
- table: "TPNT_Store",
- column: "C_CreateBy");
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_Store_C_LastUpdatedBy",
- table: "TPNT_Store",
- column: "C_LastUpdatedBy");
- migrationBuilder.CreateIndex(
- name: "IX_TPNT_StoreOrg_C_CreateBy",
- table: "TPNT_StoreOrg",
- column: "C_CreateBy");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "TPNT_Area");
- migrationBuilder.DropTable(
- name: "TPNT_Store");
- migrationBuilder.DropTable(
- name: "TPNT_StoreOrg");
- migrationBuilder.DropTable(
- name: "TPNT_Type");
- }
- }
- }
|