53 lines
2.5 KiB
C#
53 lines
2.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace GrossesMitainesAPI.Migrations
|
|
{
|
|
public partial class InitialDb : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Products",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Title = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false),
|
|
Category = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
|
Quantity = table.Column<long>(type: "bigint", nullable: false),
|
|
Status = table.Column<int>(type: "int", nullable: false),
|
|
ImageName = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Products", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Products",
|
|
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Status", "Title" },
|
|
values: new object[] { 1, "Linge", "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", "ceintureflechee", 85.86m, 1L, 4, "Ceinture flèchée" });
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Products",
|
|
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Status", "Title" },
|
|
values: new object[] { 2, "Linge", "Parce que ça sent la coupe!", "pantouflesCH", 15.64m, 54L, 0, "Pantoufles du Canadien en Phentex" });
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Products",
|
|
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Status", "Title" },
|
|
values: new object[] { 3, "Homme", "On ne lui ferait pas mal, en tout cas!!", "jeanlucmongrain", 1453.12m, 1L, 3, "Jean-Luc Mongrain" });
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Products");
|
|
}
|
|
}
|
|
}
|