|
|
|
@ -0,0 +1,84 @@
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
|
|
|
|
|
|
namespace Entities.Migrations
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class myFirstMigration : Migration
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "champions",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
|
|
|
|
|
Bio = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: true),
|
|
|
|
|
Class = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_champions", x => x.Name);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "skins",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Price = table.Column<float>(type: "REAL", nullable: false),
|
|
|
|
|
ChampionForeignKey = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_skins", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_skins_champions_ChampionForeignKey",
|
|
|
|
|
column: x => x.ChampionForeignKey,
|
|
|
|
|
principalTable: "champions",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "champions",
|
|
|
|
|
columns: new[] { "Name", "Bio", "Class", "Icon" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Armure", "Solide", 6, null },
|
|
|
|
|
{ "Dave", "Le meilleur Jazzman de France", 2, null }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "skins",
|
|
|
|
|
columns: new[] { "Name", "ChampionForeignKey", "Description", "Icon", "Price" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Armure Fullspeed", "Armure", "Deja vu", "aaa", 9.99f },
|
|
|
|
|
{ "Dave de glace", "Dave", "Enneigé", "aaa", 7.99f }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_skins_ChampionForeignKey",
|
|
|
|
|
table: "skins",
|
|
|
|
|
column: "ChampionForeignKey");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "skins");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "champions");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|