53 lines
2.6 KiB
C#
53 lines
2.6 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),
|
|
isDiscontinued = table.Column<bool>(type: "bit", 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", "Title", "isDiscontinued" },
|
|
values: new object[] { 1, "Linge", "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", "ceintureflechee", 85.86m, 1L, "Ceinture flèchée", false });
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Products",
|
|
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Title", "isDiscontinued" },
|
|
values: new object[] { 2, "Linge", "Parce que ça sent la coupe!", "pantouflesCH", 15.64m, 54L, "Pantoufles du Canadien en Phentex", false });
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Products",
|
|
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "Quantity", "Title", "isDiscontinued" },
|
|
values: new object[] { 3, "Homme", "On ne lui ferait pas mal, en tout cas!!", "jeanlucmongrain", 1453.12m, 1L, "Jean-Luc Mongrain", true });
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Products");
|
|
}
|
|
}
|
|
}
|