using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class addtablecronjobprobation : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "Year", table: "InsigniaPeriods", type: "int", nullable: false, comment: "ปี", oldClrType: typeof(int), oldType: "int"); migrationBuilder.AlterColumn( name: "Type", table: "InsigniaPeriods", type: "varchar(10)", maxLength: 10, nullable: true, comment: "ประเภทการขอ", oldClrType: typeof(string), oldType: "varchar(10)", oldMaxLength: 10, oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "StartDate", table: "InsigniaPeriods", type: "datetime(6)", nullable: false, comment: "วันที่เริ่ม", oldClrType: typeof(DateTime), oldType: "datetime(6)"); migrationBuilder.AlterColumn( name: "Name", table: "InsigniaPeriods", type: "varchar(200)", maxLength: 200, nullable: true, comment: "ชื่อรอบเสนอขอเครื่องราชฯ", oldClrType: typeof(string), oldType: "varchar(200)", oldMaxLength: 200, oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "EndDate", table: "InsigniaPeriods", type: "datetime(6)", nullable: false, comment: "วันที่สิ้นสุด", oldClrType: typeof(DateTime), oldType: "datetime(6)"); migrationBuilder.AlterColumn( name: "Amount", table: "InsigniaPeriods", type: "int", maxLength: 50, nullable: false, comment: "จำนวนวันแจ้งเตือนล่วงหน้า", oldClrType: typeof(int), oldType: "int", oldMaxLength: 50); migrationBuilder.CreateTable( name: "CronjobNotiProbations", 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"), Subject = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง") .Annotation("MySql:CharSet", "utf8mb4"), Body = table.Column(type: "text", nullable: false, comment: "รายละเอียดข้อความ") .Annotation("MySql:CharSet", "utf8mb4"), ReceiverUserId = table.Column(type: "char(36)", nullable: false, comment: "รหัสผู้รับข้อความ", collation: "ascii_general_ci"), Payload = table.Column(type: "text", nullable: false, comment: "สิงที่แนบมาด้วย") .Annotation("MySql:CharSet", "utf8mb4"), IsSendMail = table.Column(type: "tinyint(1)", nullable: false, comment: "ส่งอีเมล์หรือไม่?"), IsSendInbox = table.Column(type: "tinyint(1)", nullable: false, comment: "ส่งกล่องข้อความหรือไม่?"), ReceiveDate = table.Column(type: "datetime(6)", nullable: false, comment: "วันที่ได้รับ") }, constraints: table => { table.PrimaryKey("PK_CronjobNotiProbations", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CronjobNotiProbations"); migrationBuilder.AlterColumn( name: "Year", table: "InsigniaPeriods", type: "int", nullable: false, oldClrType: typeof(int), oldType: "int", oldComment: "ปี"); migrationBuilder.AlterColumn( name: "Type", table: "InsigniaPeriods", type: "varchar(10)", maxLength: 10, nullable: true, oldClrType: typeof(string), oldType: "varchar(10)", oldMaxLength: 10, oldNullable: true, oldComment: "ประเภทการขอ") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "StartDate", table: "InsigniaPeriods", type: "datetime(6)", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime(6)", oldComment: "วันที่เริ่ม"); migrationBuilder.AlterColumn( name: "Name", table: "InsigniaPeriods", type: "varchar(200)", maxLength: 200, nullable: true, oldClrType: typeof(string), oldType: "varchar(200)", oldMaxLength: 200, oldNullable: true, oldComment: "ชื่อรอบเสนอขอเครื่องราชฯ") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "EndDate", table: "InsigniaPeriods", type: "datetime(6)", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime(6)", oldComment: "วันที่สิ้นสุด"); migrationBuilder.AlterColumn( name: "Amount", table: "InsigniaPeriods", type: "int", maxLength: 50, nullable: false, oldClrType: typeof(int), oldType: "int", oldMaxLength: 50, oldComment: "จำนวนวันแจ้งเตือนล่วงหน้า"); } } }