123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- namespace Ropin.Inspection.Model.Migrations
- {
- public partial class EditSys : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<string>(
- name: "C_LicenseCode",
- table: "TasksQz",
- type: "varchar(50) CHARACTER SET utf8mb4",
- maxLength: 50,
- nullable: false,
- defaultValue: "");
- migrationBuilder.CreateTable(
- name: "TSYS_Message",
- columns: table => new
- {
- C_Code = table.Column<Guid>(type: "char(36)", nullable: false),
- C_LicenseCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_Type = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_Content = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: false),
- C_UserID = table.Column<Guid>(type: "char(36)", nullable: false),
- C_RelatedModule = table.Column<string>(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true),
- C_RelatedID = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, 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", maxLength: 1, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TSYS_Message", x => x.C_Code);
- table.ForeignKey(
- name: "FK_TSYS_Message_TSYS_User_C_CreateBy",
- column: x => x.C_CreateBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TSYS_Message_TSYS_User_C_LastUpdatedBy",
- column: x => x.C_LastUpdatedBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TSYS_Message_TSYS_User_C_UserID",
- column: x => x.C_UserID,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "TSYS_Version",
- columns: table => new
- {
- C_ID = table.Column<Guid>(type: "char(36)", nullable: false),
- C_AppCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_VersionCode = table.Column<string>(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false),
- C_UpdateContent = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: false),
- C_DownloadURL = table.Column<string>(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: false),
- 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", maxLength: 1, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TSYS_Version", x => x.C_ID);
- table.ForeignKey(
- name: "FK_TSYS_Version_TSYS_User_C_CreateBy",
- column: x => x.C_CreateBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_TSYS_Version_TSYS_User_C_LastUpdatedBy",
- column: x => x.C_LastUpdatedBy,
- principalTable: "TSYS_User",
- principalColumn: "C_UserID",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateIndex(
- name: "IX_TSYS_Message_C_CreateBy",
- table: "TSYS_Message",
- column: "C_CreateBy");
- migrationBuilder.CreateIndex(
- name: "IX_TSYS_Message_C_LastUpdatedBy",
- table: "TSYS_Message",
- column: "C_LastUpdatedBy");
- migrationBuilder.CreateIndex(
- name: "IX_TSYS_Message_C_UserID",
- table: "TSYS_Message",
- column: "C_UserID");
- migrationBuilder.CreateIndex(
- name: "IX_TSYS_Version_C_CreateBy",
- table: "TSYS_Version",
- column: "C_CreateBy");
- migrationBuilder.CreateIndex(
- name: "IX_TSYS_Version_C_LastUpdatedBy",
- table: "TSYS_Version",
- column: "C_LastUpdatedBy");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "TSYS_Message");
- migrationBuilder.DropTable(
- name: "TSYS_Version");
- migrationBuilder.DropColumn(
- name: "C_LicenseCode",
- table: "TasksQz");
- }
- }
- }
|