using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class AddMessageQueue : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "MessageQueues", 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"), SenderSystem = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ส่งจากระบบงาน") .Annotation("MySql:CharSet", "utf8mb4"), Subject = table.Column(type: "varchar(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง") .Annotation("MySql:CharSet", "utf8mb4"), MessageContent = table.Column(type: "longtext", nullable: false, comment: "รายละเอียดข้อความ") .Annotation("MySql:CharSet", "utf8mb4"), MessagePayLoad = table.Column(type: "longtext", nullable: false, comment: "สิ่งที่แนบมาด้วย") .Annotation("MySql:CharSet", "utf8mb4"), ReceiverUserId = table.Column(type: "char(36)", nullable: false, comment: "รหัสของผู้รับข้อความ", collation: "ascii_general_ci"), IsSendEmail = table.Column(type: "tinyint(1)", nullable: false, comment: "ส่งอีเมลล์หรือไม่?"), IsSendInbox = table.Column(type: "tinyint(1)", nullable: false, comment: "ส่งไปที่กล่องข้อความหรือไม่?"), IsSendNotification = table.Column(type: "tinyint(1)", nullable: false, comment: "ส่งการแจ้งเตือนหรือไม่?"), IsSend = table.Column(type: "tinyint(1)", nullable: false, comment: "ทำการส่งข้อความแล้วหรือยัง?") }, constraints: table => { table.PrimaryKey("PK_MessageQueues", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "MessageQueues"); } } }