using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Ropin.Inspection.Model.Migrations { public partial class Init : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Report", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), I_Type = table.Column(type: "int", nullable: false), C_GroupName = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), D_CreateTime = table.Column(type: "datetime(6)", nullable: false), D_Start = table.Column(type: "datetime(6)", nullable: false), D_End = table.Column(type: "datetime(6)", nullable: false), C_Data = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), C_Remark = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), C_Status = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Report", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TasksQz", columns: table => new { Id = table.Column(type: "char(36)", nullable: false), Name = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true), JobGroup = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true), Cron = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true), AssemblyName = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true), ClassName = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: true), Remark = table.Column(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true), RunTimes = table.Column(type: "int", nullable: false), BeginTime = table.Column(type: "datetime(6)", nullable: false), EndTime = table.Column(type: "datetime(6)", nullable: false), TriggerType = table.Column(type: "int", nullable: false), IntervalSecond = table.Column(type: "int", nullable: false), CycleRunTimes = table.Column(type: "int", nullable: false), IsStart = table.Column(type: "tinyint(1)", nullable: false), JobParams = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), IsDeleted = table.Column(type: "tinyint(1)", nullable: true), CreateTime = table.Column(type: "datetime(6)", nullable: false), CreateBy = table.Column(type: "char(36)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TasksQz", x => x.Id); }); migrationBuilder.CreateTable( name: "TISP_Content", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_AlarmLevel = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true) }, constraints: table => { table.PrimaryKey("PK_TISP_Content", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_ContentGroup", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), G_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), G_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false), I_Type = table.Column(type: "int", nullable: false), C_PatrolItem = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true) }, constraints: table => { table.PrimaryKey("PK_TISP_ContentGroup", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TISP_ContentGroupItem", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), G_ContentGroupCode = table.Column(type: "char(36)", nullable: false), G_ContentCode = table.Column(type: "char(36)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_ContentGroupItem", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TISP_Record", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_Record", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_RecordAlarm", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_InspectionRecordCode = table.Column(type: "char(36)", nullable: false), C_SpotContentCode = table.Column(type: "char(36)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_RecordAlarm", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_RecordImage", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_RecordItemCode = table.Column(type: "char(36)", nullable: false), C_ImageURL = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_RecordImage", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_RecordItem", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_ContentCode = table.Column(type: "char(36)", nullable: false), C_RecordCode = table.Column(type: "char(36)", nullable: false), C_InspectionContent = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), C_Remark = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false), C_CreateBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_RecordItem", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_Region", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_ImageUrl = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_CreateBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_Region", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_Route", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_ImageUrl = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_CreateBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_Route", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_Spot", columns: table => new { C_Code = table.Column(type: "char(36)", nullable: false), C_Number = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Position = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_QRCode = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_GPS = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_ImageUrl = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), I_Offset = table.Column(type: "int", nullable: false), C_CreateBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(50)", maxLength: 50, nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_Spot", x => x.C_Code); }); migrationBuilder.CreateTable( name: "TISP_SpotContent", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_ContentCode = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_SpotContent", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_SpotRegion", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_RegionCode = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_SpotRegion", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_SpotRoute", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_RouteCode = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_SpotRoute", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TISP_SpotUser", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_UserCode = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TISP_SpotUser", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TSEC_Record", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_SpotCode = table.Column(type: "char(36)", nullable: false), C_SecurityContent = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSEC_Record", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TSEC_RecordImage", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_SecurityRecordCode = table.Column(type: "char(36)", nullable: false), C_ImageURL = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSEC_RecordImage", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TSEC_RecordItem", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_RecordItemCode = table.Column(type: "char(36)", nullable: false), C_SecurityContent = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSEC_RecordItem", x => x.C_ID); }); migrationBuilder.CreateTable( name: "TSYS_Organize", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), G_ParentCode = table.Column(type: "char(36)", nullable: false), C_Number = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_ParentName = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_ParentCodeList = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), I_Layer = table.Column(type: "int", nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_Address = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_GPS = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_ImageUrl = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), G_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), G_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_Organize", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TSYS_Post", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), C_Code = table.Column(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), G_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), G_LastUpdatedBy = table.Column(type: "char(36)", nullable: false), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: false), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_Post", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TSYS_Priv", columns: table => new { C_Code = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_ParentCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Module = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Type = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_ImageUrl = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_PageUrl = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_Remark = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_Priv", x => x.C_Code); table.ForeignKey( name: "FK_TSYS_Priv_TSYS_Priv_C_ParentCode", column: x => x.C_ParentCode, principalTable: "TSYS_Priv", principalColumn: "C_Code", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_User", columns: table => new { C_UserID = table.Column(type: "char(36)", nullable: false), C_LicenseCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Post = table.Column(type: "char(36)", nullable: true), C_UserName = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_WechatID = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_ProgramID = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_Password = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), C_Name = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), I_Render = table.Column(type: "int", nullable: false), C_IDNum = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), C_OrgCode = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), C_ImagePath = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), D_BirthDay = table.Column(type: "datetime(6)", nullable: false), C_Address = table.Column(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: true), I_Sort = table.Column(type: "int", nullable: false), C_Mobile = table.Column(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true), C_Phone = table.Column(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true), C_Email = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: true), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", maxLength: 1, nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_User", x => x.C_UserID); table.ForeignKey( name: "FK_TSYS_User_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_User_TSYS_User_C_LastUpdatedBy", column: x => x.C_LastUpdatedBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_UserPost", columns: table => new { G_ID = table.Column(type: "char(36)", nullable: false), G_UserCode = table.Column(type: "char(36)", nullable: false), G_PostCode = table.Column(type: "char(36)", nullable: false), G_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_UserPost", x => x.G_ID); }); migrationBuilder.CreateTable( name: "TaskInfoDto", columns: table => new { jobId = table.Column(type: "varchar(255) CHARACTER SET utf8mb4", nullable: false), jobName = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), jobGroup = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), triggerId = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), triggerName = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), triggerGroup = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), triggerStatus = table.Column(type: "longtext CHARACTER SET utf8mb4", nullable: true), TasksQzId = table.Column(type: "char(36)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_TaskInfoDto", x => x.jobId); table.ForeignKey( name: "FK_TaskInfoDto_TasksQz_TasksQzId", column: x => x.TasksQzId, principalTable: "TasksQz", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_LicenseType", columns: table => new { C_Code = table.Column(type: "char(36)", nullable: false), C_Name = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), I_MaxMemberQty = table.Column(type: "int", nullable: false), I_MaxStoreQty = table.Column(type: "int", nullable: false), I_MaxFileSize = table.Column(type: "int", nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: true), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_LicenseType", x => x.C_Code); table.ForeignKey( name: "FK_TSYS_LicenseType_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_LicenseType_TSYS_User_C_LastUpdatedBy", column: x => x.C_LastUpdatedBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_Org", columns: table => new { K_ID = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), C_LicenseCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Code = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Name = table.Column(type: "varchar(255) CHARACTER SET utf8mb4", maxLength: 255, nullable: false), C_SName = table.Column(type: "varchar(16) CHARACTER SET utf8mb4", maxLength: 16, nullable: true), C_Lname = table.Column(type: "longtext CHARACTER SET utf8mb4", maxLength: 2550, nullable: true), C_Level = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: false), C_ParentCode = table.Column(type: "int", nullable: false), C_Type = table.Column(type: "char(36)", nullable: false), C_Phone = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Linker = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_GIS = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: true), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_Org", x => x.K_ID); table.ForeignKey( name: "FK_TSYS_Org_TSYS_Org_C_ParentCode", column: x => x.C_ParentCode, principalTable: "TSYS_Org", principalColumn: "K_ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_Org_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_Org_TSYS_User_C_LastUpdatedBy", column: x => x.C_LastUpdatedBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_Role", columns: table => new { C_Code = table.Column(type: "char(36)", nullable: false), C_LicenseCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Name = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: true), C_Description = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: true), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: true), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_Role", x => x.C_Code); table.ForeignKey( name: "FK_TSYS_Role_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_Role_TSYS_User_C_LastUpdatedBy", column: x => x.C_LastUpdatedBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_License", columns: table => new { C_ID = table.Column(type: "char(36)", nullable: false), C_TypeCode = table.Column(type: "char(36)", nullable: false), C_Code = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_Name = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false), I_MemberQty = table.Column(type: "int", nullable: false), I_DiskCapacity = table.Column(type: "int", nullable: false), C_FilePath = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: false), D_StartDate = table.Column(type: "datetime(6)", nullable: false), D_EndDate = table.Column(type: "datetime(6)", nullable: false), I_Sort = table.Column(type: "int", nullable: false), C_Remark = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), C_LastUpdatedBy = table.Column(type: "char(36)", nullable: true), D_LastUpdatedOn = table.Column(type: "datetime(6)", nullable: true), C_Status = table.Column(type: "varchar(1) CHARACTER SET utf8mb4", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_License", x => x.C_ID); table.ForeignKey( name: "FK_TSYS_License_TSYS_LicenseType_C_TypeCode", column: x => x.C_TypeCode, principalTable: "TSYS_LicenseType", principalColumn: "C_Code", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_License_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_License_TSYS_User_C_LastUpdatedBy", column: x => x.C_LastUpdatedBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_LicenseTypePriv", columns: table => new { C_LicenseTypeCode = table.Column(type: "char(36)", nullable: false), C_PrivilegeCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_LicenseTypePriv", x => new { x.C_LicenseTypeCode, x.C_PrivilegeCode }); table.ForeignKey( name: "FK_TSYS_LicenseTypePriv_TSYS_LicenseType_C_LicenseTypeCode", column: x => x.C_LicenseTypeCode, principalTable: "TSYS_LicenseType", principalColumn: "C_Code", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_LicenseTypePriv_TSYS_Priv_C_PrivilegeCode", column: x => x.C_PrivilegeCode, principalTable: "TSYS_Priv", principalColumn: "C_Code", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_LicenseTypePriv_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "TSYS_RolePriv", columns: table => new { C_RoleCode = table.Column(type: "char(36)", nullable: false), C_PrivilegeCode = table.Column(type: "varchar(50) CHARACTER SET utf8mb4", maxLength: 50, nullable: false), C_CreateBy = table.Column(type: "char(36)", nullable: false), D_CreateOn = table.Column(type: "datetime(6)", nullable: false), I_Type = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TSYS_RolePriv", x => new { x.C_RoleCode, x.C_PrivilegeCode }); table.ForeignKey( name: "FK_TSYS_RolePriv_TSYS_Role_C_RoleCode", column: x => x.C_RoleCode, principalTable: "TSYS_Role", principalColumn: "C_Code", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_TSYS_RolePriv_TSYS_User_C_CreateBy", column: x => x.C_CreateBy, principalTable: "TSYS_User", principalColumn: "C_UserID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_TaskInfoDto_TasksQzId", table: "TaskInfoDto", column: "TasksQzId"); migrationBuilder.CreateIndex( name: "IX_TSYS_License_C_Code", table: "TSYS_License", column: "C_Code", unique: true); migrationBuilder.CreateIndex( name: "IX_TSYS_License_C_CreateBy", table: "TSYS_License", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_License_C_LastUpdatedBy", table: "TSYS_License", column: "C_LastUpdatedBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_License_C_TypeCode", table: "TSYS_License", column: "C_TypeCode"); migrationBuilder.CreateIndex( name: "IX_TSYS_LicenseType_C_CreateBy", table: "TSYS_LicenseType", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_LicenseType_C_LastUpdatedBy", table: "TSYS_LicenseType", column: "C_LastUpdatedBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_LicenseTypePriv_C_CreateBy", table: "TSYS_LicenseTypePriv", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_LicenseTypePriv_C_PrivilegeCode", table: "TSYS_LicenseTypePriv", column: "C_PrivilegeCode"); migrationBuilder.CreateIndex( name: "IX_TSYS_Org_C_CreateBy", table: "TSYS_Org", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_Org_C_LastUpdatedBy", table: "TSYS_Org", column: "C_LastUpdatedBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_Org_C_ParentCode", table: "TSYS_Org", column: "C_ParentCode"); migrationBuilder.CreateIndex( name: "IX_TSYS_Priv_C_ParentCode", table: "TSYS_Priv", column: "C_ParentCode"); migrationBuilder.CreateIndex( name: "IX_TSYS_Role_C_CreateBy", table: "TSYS_Role", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_Role_C_LastUpdatedBy", table: "TSYS_Role", column: "C_LastUpdatedBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_RolePriv_C_CreateBy", table: "TSYS_RolePriv", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_User_C_CreateBy", table: "TSYS_User", column: "C_CreateBy"); migrationBuilder.CreateIndex( name: "IX_TSYS_User_C_LastUpdatedBy", table: "TSYS_User", column: "C_LastUpdatedBy"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Report"); migrationBuilder.DropTable( name: "TaskInfoDto"); migrationBuilder.DropTable( name: "TISP_Content"); migrationBuilder.DropTable( name: "TISP_ContentGroup"); migrationBuilder.DropTable( name: "TISP_ContentGroupItem"); migrationBuilder.DropTable( name: "TISP_Record"); migrationBuilder.DropTable( name: "TISP_RecordAlarm"); migrationBuilder.DropTable( name: "TISP_RecordImage"); migrationBuilder.DropTable( name: "TISP_RecordItem"); migrationBuilder.DropTable( name: "TISP_Region"); migrationBuilder.DropTable( name: "TISP_Route"); migrationBuilder.DropTable( name: "TISP_Spot"); migrationBuilder.DropTable( name: "TISP_SpotContent"); migrationBuilder.DropTable( name: "TISP_SpotRegion"); migrationBuilder.DropTable( name: "TISP_SpotRoute"); migrationBuilder.DropTable( name: "TISP_SpotUser"); migrationBuilder.DropTable( name: "TSEC_Record"); migrationBuilder.DropTable( name: "TSEC_RecordImage"); migrationBuilder.DropTable( name: "TSEC_RecordItem"); migrationBuilder.DropTable( name: "TSYS_License"); migrationBuilder.DropTable( name: "TSYS_LicenseTypePriv"); migrationBuilder.DropTable( name: "TSYS_Org"); migrationBuilder.DropTable( name: "TSYS_Organize"); migrationBuilder.DropTable( name: "TSYS_Post"); migrationBuilder.DropTable( name: "TSYS_RolePriv"); migrationBuilder.DropTable( name: "TSYS_UserPost"); migrationBuilder.DropTable( name: "TasksQz"); migrationBuilder.DropTable( name: "TSYS_LicenseType"); migrationBuilder.DropTable( name: "TSYS_Priv"); migrationBuilder.DropTable( name: "TSYS_Role"); migrationBuilder.DropTable( name: "TSYS_User"); } } }