using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Recurit.Exam.Service.Migrations { /// public partial class createtableadddisable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ImportFileId", table: "PeriodExams", type: "char(36)", nullable: true, collation: "ascii_general_ci"); migrationBuilder.AlterColumn( name: "RelationshipName", table: "Candidates", type: "longtext", nullable: true, comment: "สถานภาพ", oldClrType: typeof(string), oldType: "longtext", oldNullable: true, oldComment: "ศาสนา") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "RelationshipId", table: "Candidates", type: "char(36)", nullable: true, comment: "Id สถานภาพ", collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true, oldComment: "Id ศาสนา") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.CreateTable( name: "DisableImportHistories", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"), Description = table.Column(type: "longtext", nullable: false, comment: "รายละเอียดการนำเข้า") .Annotation("MySql:CharSet", "utf8mb4"), 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") }, constraints: table => { table.PrimaryKey("PK_DisableImportHistories", x => x.Id); table.ForeignKey( name: "FK_DisableImportHistories_PeriodExams_PeriodExamId", column: x => x.PeriodExamId, principalTable: "PeriodExams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Disables", 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"), CitizenId = table.Column(type: "varchar(13)", maxLength: 13, nullable: false, comment: "เลขประจำตัวประชาชน") .Annotation("MySql:CharSet", "utf8mb4"), ExamId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Prefix = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FirstName = table.Column(type: "varchar(150)", maxLength: 150, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), LastName = table.Column(type: "varchar(150)", maxLength: 150, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Gendor = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), National = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Race = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Religion = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DateOfBirth = table.Column(type: "datetime(6)", nullable: false), Marry = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Isspecial = table.Column(type: "varchar(1)", maxLength: 1, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), RefNo = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CitizenCardIssuer = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CitizenCardExpireDate = table.Column(type: "datetime(6)", nullable: false), Remark = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Qualified = table.Column(type: "varchar(1)", maxLength: 1, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PeriodExamId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedDate = table.Column(type: "datetime(6)", nullable: false), ModifiedDate = table.Column(type: "datetime(6)", nullable: false), ApplyDate = table.Column(type: "datetime(6)", nullable: false), PositionName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Disables", x => x.Id); table.ForeignKey( name: "FK_Disables_PeriodExams_PeriodExamId", column: x => x.PeriodExamId, principalTable: "PeriodExams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ScoreImports", 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"), Year = table.Column(type: "int", nullable: true), ImportFileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PeriodExamId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ScoreImports", x => x.Id); table.ForeignKey( name: "FK_ScoreImports_Documents_ImportFileId", column: x => x.ImportFileId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ScoreImports_PeriodExams_PeriodExamId", column: x => x.PeriodExamId, principalTable: "PeriodExams", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableAddresses", 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"), Address = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Moo = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Soi = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Road = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), District = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Amphur = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Province = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ZipCode = table.Column(type: "varchar(5)", maxLength: 5, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Telephone = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Mobile = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Address1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Moo1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Soi1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Road1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), District1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Amphur1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Province1 = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ZipCode1 = table.Column(type: "varchar(5)", maxLength: 5, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableAddresses", x => x.Id); table.ForeignKey( name: "FK_DisableAddresses_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableCertificates", 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"), CertificateNo = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), IssueDate = table.Column(type: "datetime(6)", nullable: false), ExpiredDate = table.Column(type: "datetime(6)", nullable: false), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableCertificates", x => x.Id); table.ForeignKey( name: "FK_DisableCertificates_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableDocuments", 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"), CreatedDate = table.Column(type: "datetime(6)", nullable: false), DocumentFileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableDocuments", x => x.Id); table.ForeignKey( name: "FK_DisableDocuments_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_DisableDocuments_Documents_DocumentFileId", column: x => x.DocumentFileId, principalTable: "Documents", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableEducations", 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"), Degree = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Major = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), MajorGroupId = table.Column(type: "varchar(20)", maxLength: 20, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), MajorGroupName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), University = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), GPA = table.Column(type: "double", nullable: false), Specialist = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), HighDegree = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), BachelorDate = table.Column(type: "datetime(6)", nullable: false), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableEducations", x => x.Id); table.ForeignKey( name: "FK_DisableEducations_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableOccupations", 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"), Occupation = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), WorkAge = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Position = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Workplace = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Telephone = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableOccupations", x => x.Id); table.ForeignKey( name: "FK_DisableOccupations_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisablePayments", 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"), PaymentId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CompanyCode = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TextFile = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), BankCode = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), AccountNumber = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TransDate = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TransTime = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CustomerName = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), RefNo1 = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TermBranch = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TellerId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreditDebit = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), PaymentType = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ChequeNo = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Amount = table.Column(type: "decimal(65,30)", nullable: false), ChqueBankCode = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DisableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisablePayments", x => x.Id); table.ForeignKey( name: "FK_DisablePayments_Disables_DisableId", column: x => x.DisableId, principalTable: "Disables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "DisableScores", 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"), ExamId = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SumA = table.Column(type: "int", nullable: false), FullA = table.Column(type: "int", nullable: false), PercentageA = table.Column(type: "double", nullable: false), AStatus = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SumB = table.Column(type: "int", nullable: false), FullB = table.Column(type: "int", nullable: false), PercentageB = table.Column(type: "double", nullable: false), BStatus = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SumAB = table.Column(type: "int", nullable: false), ABStatus = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SumC = table.Column(type: "int", nullable: false), FullC = table.Column(type: "int", nullable: false), PercentageC = table.Column(type: "double", nullable: false), CStatus = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ExamStatus = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Major = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Number = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ลำดับที่สอบได้") .Annotation("MySql:CharSet", "utf8mb4"), ScoreImportId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_DisableScores", x => x.Id); table.ForeignKey( name: "FK_DisableScores_ScoreImports_ScoreImportId", column: x => x.ScoreImportId, principalTable: "ScoreImports", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_PeriodExams_ImportFileId", table: "PeriodExams", column: "ImportFileId"); migrationBuilder.CreateIndex( name: "IX_DisableAddresses_DisableId", table: "DisableAddresses", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_DisableCertificates_DisableId", table: "DisableCertificates", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_DisableDocuments_DisableId", table: "DisableDocuments", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_DisableDocuments_DocumentFileId", table: "DisableDocuments", column: "DocumentFileId"); migrationBuilder.CreateIndex( name: "IX_DisableEducations_DisableId", table: "DisableEducations", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_DisableImportHistories_PeriodExamId", table: "DisableImportHistories", column: "PeriodExamId"); migrationBuilder.CreateIndex( name: "IX_DisableOccupations_DisableId", table: "DisableOccupations", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_DisablePayments_DisableId", table: "DisablePayments", column: "DisableId"); migrationBuilder.CreateIndex( name: "IX_Disables_PeriodExamId", table: "Disables", column: "PeriodExamId"); migrationBuilder.CreateIndex( name: "IX_DisableScores_ScoreImportId", table: "DisableScores", column: "ScoreImportId"); migrationBuilder.CreateIndex( name: "IX_ScoreImports_ImportFileId", table: "ScoreImports", column: "ImportFileId"); migrationBuilder.CreateIndex( name: "IX_ScoreImports_PeriodExamId", table: "ScoreImports", column: "PeriodExamId", unique: true); migrationBuilder.AddForeignKey( name: "FK_PeriodExams_Documents_ImportFileId", table: "PeriodExams", column: "ImportFileId", principalTable: "Documents", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PeriodExams_Documents_ImportFileId", table: "PeriodExams"); migrationBuilder.DropTable( name: "DisableAddresses"); migrationBuilder.DropTable( name: "DisableCertificates"); migrationBuilder.DropTable( name: "DisableDocuments"); migrationBuilder.DropTable( name: "DisableEducations"); migrationBuilder.DropTable( name: "DisableImportHistories"); migrationBuilder.DropTable( name: "DisableOccupations"); migrationBuilder.DropTable( name: "DisablePayments"); migrationBuilder.DropTable( name: "DisableScores"); migrationBuilder.DropTable( name: "Disables"); migrationBuilder.DropTable( name: "ScoreImports"); migrationBuilder.DropIndex( name: "IX_PeriodExams_ImportFileId", table: "PeriodExams"); migrationBuilder.DropColumn( name: "ImportFileId", table: "PeriodExams"); migrationBuilder.AlterColumn( name: "RelationshipName", table: "Candidates", type: "longtext", nullable: true, comment: "ศาสนา", oldClrType: typeof(string), oldType: "longtext", oldNullable: true, oldComment: "สถานภาพ") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "RelationshipId", table: "Candidates", type: "char(36)", nullable: true, comment: "Id ศาสนา", collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true, oldComment: "Id สถานภาพ") .OldAnnotation("Relational:Collation", "ascii_general_ci"); } } }