39 lines
1.6 KiB
C#
39 lines
1.6 KiB
C#
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace UTB.Eshop.Web.Migrations.MySql
|
|
{
|
|
public partial class MySql_101 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Product",
|
|
columns: table => new
|
|
{
|
|
ID = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "longtext", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Price = table.Column<double>(type: "double", nullable: false),
|
|
Quantity = table.Column<int>(type: "int", nullable: false),
|
|
Description = table.Column<string>(type: "longtext", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ImageSource = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Product", x => x.ID);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Product");
|
|
}
|
|
}
|
|
}
|