using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional namespace Blueprint.Infra.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Category", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CoverImage = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Title = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Content = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "tinyint(1)", nullable: false), Date = table.Column(type: "datetime(6)", nullable: false), Modified = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Category", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "User", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Email = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Picture = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Role = table.Column(type: "int", nullable: false), Status = table.Column(type: "tinyint(1)", nullable: false), Date = table.Column(type: "datetime(6)", nullable: false), Modified = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_User", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Product", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CoverImage = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Title = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Content = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CategoryId = table.Column(type: "int", nullable: true), Status = table.Column(type: "tinyint(1)", nullable: false), Date = table.Column(type: "datetime(6)", nullable: false), Modified = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Product", x => x.Id); table.ForeignKey( name: "FK_Product_Category_CategoryId", column: x => x.CategoryId, principalTable: "Category", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.InsertData( table: "Category", columns: new[] { "Id", "Content", "CoverImage", "Date", "Modified", "Name", "Status", "Title" }, values: new object[,] { { 1, null, null, new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6934), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6935), "Item 1", true, null }, { 2, null, null, new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6937), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6937), "Item 2", true, null } }); migrationBuilder.InsertData( table: "User", columns: new[] { "Id", "Date", "Email", "Modified", "Name", "Picture", "Role", "Status" }, values: new object[,] { { 1, new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6827), "", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6827), "Test", null, 0, true }, { 2, new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6830), "truongdxfx08031@funix.edu.vn", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6830), "Truong Dang", null, 0, true }, { 3, new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6832), "truonghusk17aws1@gmail.com", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6833), "Thai Son", null, 0, true } }); migrationBuilder.InsertData( table: "Product", columns: new[] { "Id", "CategoryId", "Content", "CoverImage", "Date", "Modified", "Name", "Status", "Title" }, values: new object[,] { { 1, 1, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6954), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6954), "Item 1", true, null }, { 2, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6956), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6957), "Item 2", true, null }, { 3, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6959), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6959), "Item 3", true, null }, { 4, 1, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6961), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6962), "Item 4", true, null }, { 5, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6964), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6964), "Item 5", true, null }, { 6, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-1.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6966), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6966), "Item 6", true, null }, { 7, 1, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-303.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6968), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6969), "Item 7", true, null }, { 8, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Premtilmiue.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6971), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6971), "Item 8", true, null }, { 9, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Protile.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6973), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6973), "Item 9", true, null }, { 10, 1, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/keo-dan-gach-TOA-Supertile.png", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6975), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6976), "Item 10", true, null }, { 11, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-Sealant-HP.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6978), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6978), "Item 11", true, null }, { 12, 2, null, "https://innocons.s3.ap-southeast-1.amazonaws.com/products/Silicone-TOA-.jpg", new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6980), new DateTime(2025, 4, 6, 6, 56, 0, 937, DateTimeKind.Local).AddTicks(6980), "Item 12", true, null } }); migrationBuilder.CreateIndex( name: "IX_Product_CategoryId", table: "Product", column: "CategoryId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Product"); migrationBuilder.DropTable( name: "User"); migrationBuilder.DropTable( name: "Category"); } } }