using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Recurit.Exam.Service.Migrations { /// public partial class updatetableperiodaddqrcode : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "IsActive", table: "ScoreImports"); migrationBuilder.DropColumn( name: "IsActive", table: "PositionExams"); migrationBuilder.DropColumn( name: "IsActive", table: "PeriodExamImages"); migrationBuilder.DropColumn( name: "IsActive", table: "PeriodExamDocuments"); migrationBuilder.DropColumn( name: "IsActive", table: "Educations"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableScores"); migrationBuilder.DropColumn( name: "IsActive", table: "Disables"); migrationBuilder.DropColumn( name: "IsActive", table: "DisablePayments"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableOccupations"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableImportHistories"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableEducations"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableDocuments"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableCertificates"); migrationBuilder.DropColumn( name: "IsActive", table: "DisableAddresses"); migrationBuilder.DropColumn( name: "IsActive", table: "CMSGovernments"); migrationBuilder.DropColumn( name: "IsActive", table: "CMSCandidates"); migrationBuilder.DropColumn( name: "IsActive", table: "CMSAgencys"); migrationBuilder.DropColumn( name: "IsActive", table: "Careers"); migrationBuilder.DropColumn( name: "IsActive", table: "Candidates"); migrationBuilder.DropColumn( name: "IsActive", table: "CandidateDocuments"); migrationBuilder.DropColumn( name: "IsActive", table: "BankExams"); migrationBuilder.AddColumn( name: "CompanyCode", table: "PeriodExams", type: "longtext", nullable: true, comment: "Company code") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "CustomerName", table: "PeriodExams", type: "longtext", nullable: true, comment: "Customer name") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Reason", table: "PeriodExams", type: "text", nullable: true, comment: "หมายเหตุ") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "RefNo1", table: "PeriodExams", type: "longtext", nullable: true, comment: "Ref No1") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "Remark", table: "PeriodExams", type: "text", nullable: true, comment: "remark") .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PeriodExamBarCodes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), PeriodExamId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PeriodExamBarCodes", x => x.Id); table.ForeignKey( name: "FK_PeriodExamBarCodes_Documents_DocumentId", column: x => x.DocumentId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PeriodExamBarCodes_PeriodExams_PeriodExamId", column: x => x.PeriodExamId, principalTable: "PeriodExams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PeriodExamQrCodes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), CreatedAt = table.Column(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"), CreatedUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdatedAt = table.Column(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"), LastUpdateUserId = table.Column(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), CreatedFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล") .Annotation("MySql:CharSet", "utf8mb4"), LastUpdateFullName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด") .Annotation("MySql:CharSet", "utf8mb4"), PeriodExamId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), DocumentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PeriodExamQrCodes", x => x.Id); table.ForeignKey( name: "FK_PeriodExamQrCodes_Documents_DocumentId", column: x => x.DocumentId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PeriodExamQrCodes_PeriodExams_PeriodExamId", column: x => x.PeriodExamId, principalTable: "PeriodExams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_PeriodExamBarCodes_DocumentId", table: "PeriodExamBarCodes", column: "DocumentId"); migrationBuilder.CreateIndex( name: "IX_PeriodExamBarCodes_PeriodExamId", table: "PeriodExamBarCodes", column: "PeriodExamId"); migrationBuilder.CreateIndex( name: "IX_PeriodExamQrCodes_DocumentId", table: "PeriodExamQrCodes", column: "DocumentId"); migrationBuilder.CreateIndex( name: "IX_PeriodExamQrCodes_PeriodExamId", table: "PeriodExamQrCodes", column: "PeriodExamId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PeriodExamBarCodes"); migrationBuilder.DropTable( name: "PeriodExamQrCodes"); migrationBuilder.DropColumn( name: "CompanyCode", table: "PeriodExams"); migrationBuilder.DropColumn( name: "CustomerName", table: "PeriodExams"); migrationBuilder.DropColumn( name: "Reason", table: "PeriodExams"); migrationBuilder.DropColumn( name: "RefNo1", table: "PeriodExams"); migrationBuilder.DropColumn( name: "Remark", table: "PeriodExams"); migrationBuilder.AddColumn( name: "IsActive", table: "ScoreImports", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "PositionExams", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "PeriodExamImages", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "PeriodExamDocuments", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "Educations", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableScores", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "Disables", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisablePayments", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableOccupations", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableImportHistories", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableEducations", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableDocuments", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableCertificates", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "DisableAddresses", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "CMSGovernments", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "CMSCandidates", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "CMSAgencys", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "Careers", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "Candidates", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "CandidateDocuments", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); migrationBuilder.AddColumn( name: "IsActive", table: "BankExams", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "สถานะการใช้งาน") .Annotation("Relational:ColumnOrder", 106); } } }