GGMM/GrossesMitaines/GrossesMitainesAPI/Migrations/20221017003248_Initial-Db.cs

54 lines
2.7 KiB
C#
Raw Normal View History

2022-10-09 13:18:39 -04:00
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),
2022-10-09 15:07:35 -04:00
Category = table.Column<string>(type: "nvarchar(max)", nullable: false),
2022-10-09 13:18:39 -04:00
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
2022-10-16 20:33:58 -04:00
PromoPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
2022-10-09 15:07:35 -04:00
Quantity = table.Column<long>(type: "bigint", nullable: false),
2022-10-16 11:25:21 -04:00
Status = table.Column<int>(type: "int", nullable: false),
2022-10-09 13:18:39 -04:00
ImageName = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.Id);
});
migrationBuilder.InsertData(
table: "Products",
2022-10-16 20:33:58 -04:00
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "PromoPrice", "Quantity", "Status", "Title" },
values: new object[] { 1, "Linge", "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", "ceintureflechee", 85.86m, 0m, 1L, 4, "Ceinture flèchée" });
2022-10-09 13:18:39 -04:00
migrationBuilder.InsertData(
table: "Products",
2022-10-16 20:33:58 -04:00
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "PromoPrice", "Quantity", "Status", "Title" },
values: new object[] { 2, "Linge", "Parce que ça sent la coupe!", "pantouflesCH", 15.64m, 0m, 54L, 0, "Pantoufles du Canadien en Phentex" });
2022-10-09 13:18:39 -04:00
migrationBuilder.InsertData(
table: "Products",
2022-10-16 20:33:58 -04:00
columns: new[] { "Id", "Category", "Description", "ImageName", "Price", "PromoPrice", "Quantity", "Status", "Title" },
values: new object[] { 3, "Homme", "On ne lui ferait pas mal, en tout cas!!", "jeanlucmongrain", 1453.12m, 0m, 1L, 3, "Jean-Luc Mongrain" });
2022-10-09 13:18:39 -04:00
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Products");
}
}
}