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