You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

342 lines
14 KiB

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace EntityFramwork.Migrations
{
/// <inheritdoc />
public partial class tp : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Images",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Base64 = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Images", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PageRunes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PageRunes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Champions",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Bio = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Classe = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champions", x => x.Id);
table.ForeignKey(
name: "FK_Champions_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Runes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Family = table.Column<string>(type: "TEXT", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Runes", x => x.Id);
table.ForeignKey(
name: "FK_Runes_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skills",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<string>(type: "TEXT", nullable: false),
ChampionId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skills", x => x.Id);
table.ForeignKey(
name: "FK_Skills_Champions_ChampionId",
column: x => x.ChampionId,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Skins",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<float>(type: "REAL", nullable: false),
ChampionId = table.Column<int>(type: "INTEGER", nullable: false),
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Skins", x => x.Id);
table.ForeignKey(
name: "FK_Skins_Champions_ChampionId",
column: x => x.ChampionId,
principalTable: "Champions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Skins_Images_ImageId",
column: x => x.ImageId,
principalTable: "Images",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CategorieRunes",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Category = table.Column<string>(type: "TEXT", nullable: false),
IdPageRune = table.Column<int>(type: "INTEGER", nullable: false),
IdRune = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CategorieRunes", x => x.Id);
table.ForeignKey(
name: "FK_CategorieRunes_PageRunes_IdPageRune",
column: x => x.IdPageRune,
principalTable: "PageRunes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CategorieRunes_Runes_IdRune",
column: x => x.IdRune,
principalTable: "Runes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "Images",
columns: new[] { "Id", "Base64" },
values: new object[,]
{
{ 1, "Inconnu !" },
{ 2, "Inconnu !" },
{ 3, "Inconnu !" },
{ 4, "Inconnu !" },
{ 5, "Inconnu !" },
{ 6, "Inconnu !" },
{ 7, "Inconnu !" },
{ 8, "Inconnu !" },
{ 9, "Inconnu !" },
{ 10, "Inconnu !" },
{ 11, "Inconnu !" },
{ 12, "Inconnu !" },
{ 13, "Inconnu !" },
{ 14, "Inconnu !" },
{ 15, "Inconnu !" },
{ 16, "Inconnu !" },
{ 17, "Inconnu !" },
{ 18, "Inconnu !" },
{ 19, "Inconnu !" },
{ 20, "Inconnu !" },
{ 21, "Inconnu !" },
{ 22, "Inconnu !" },
{ 23, "Inconnu !" },
{ 24, "Inconnu !" },
{ 25, "Inconnu !" },
{ 26, "Inconnu !" },
{ 27, "Inconnu !" },
{ 28, "Inconnu !" },
{ 29, "Inconnu !" }
});
migrationBuilder.InsertData(
table: "PageRunes",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Inconnu !" },
{ 2, "Inconnu !" },
{ 3, "Inconnu !" }
});
migrationBuilder.InsertData(
table: "Champions",
columns: new[] { "Id", "Bio", "Classe", "Icon", "ImageId", "Name" },
values: new object[,]
{
{ 1, "Inconnu !", "Assassin", "Inconnu !", 1, "Akali" },
{ 2, "Inconnu !", "Fighter", "Inconnu !", 2, "Aatrox" },
{ 3, "Inconnu !", "Mage", "Inconnu !", 3, "Ahri" },
{ 4, "Inconnu !", "Marksman", "Inconnu !", 4, "Akshan" },
{ 5, "Inconnu !", "Support", "Inconnu !", 5, "Bard" },
{ 6, "Inconnu !", "Tank", "Inconnu !", 6, "Alistar" }
});
migrationBuilder.InsertData(
table: "Runes",
columns: new[] { "Id", "Description", "Family", "Icon", "ImageId", "Name" },
values: new object[,]
{
{ 1, "Inconnu !", "Precision", "Inconnu !", 16, "Inconnu !" },
{ 2, "Inconnu !", "Domination", "Inconnu !", 17, "Inconnu !" },
{ 3, "Inconnu !", "Unknown", "Inconnu !", 18, "Inconnu !" }
});
migrationBuilder.InsertData(
table: "CategorieRunes",
columns: new[] { "Id", "Category", "IdPageRune", "IdRune" },
values: new object[,]
{
{ 1, "Major", 1, 1 },
{ 2, "Minor", 2, 2 },
{ 3, "Other", 3, 3 }
});
migrationBuilder.InsertData(
table: "Skills",
columns: new[] { "Id", "ChampionId", "Description", "Name", "Type" },
values: new object[,]
{
{ 1, 1, "Inconnu !", "Inconnu !", "Basic" },
{ 2, 2, "Inconnu !", "Inconnu !", "Ultimate" },
{ 3, 3, "Inconnu !", "Inconnu !", "Unknown" }
});
migrationBuilder.InsertData(
table: "Skins",
columns: new[] { "Id", "ChampionId", "Description", "Icon", "ImageId", "Name", "Price" },
values: new object[,]
{
{ 1, 1, "Inconnu !", "Inconnu !", 7, "Stinger", 0f },
{ 2, 1, "Inconnu !", "Inconnu !", 8, "Infernal", 0f },
{ 3, 1, "Inconnu !", "Inconnu !", 9, "All-Star", 0f },
{ 4, 2, "Inconnu !", "Inconnu !", 10, "Justicar", 0f },
{ 5, 2, "Inconnu !", "Inconnu !", 11, "Mecha", 0f },
{ 6, 3, "Inconnu !", "Inconnu !", 12, "Dynasty", 0f },
{ 7, 4, "Inconnu !", "Inconnu !", 13, "Cyber Pop", 0f },
{ 8, 5, "Inconnu !", "Inconnu !", 14, "Elderwood", 0f },
{ 9, 6, "Inconnu !", "Inconnu !", 15, "Black", 0f }
});
migrationBuilder.CreateIndex(
name: "IX_CategorieRunes_IdPageRune",
table: "CategorieRunes",
column: "IdPageRune");
migrationBuilder.CreateIndex(
name: "IX_CategorieRunes_IdRune",
table: "CategorieRunes",
column: "IdRune");
migrationBuilder.CreateIndex(
name: "IX_Champions_ImageId",
table: "Champions",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Champions_Name",
table: "Champions",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Runes_ImageId",
table: "Runes",
column: "ImageId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Skills_ChampionId",
table: "Skills",
column: "ChampionId");
migrationBuilder.CreateIndex(
name: "IX_Skins_ChampionId",
table: "Skins",
column: "ChampionId");
migrationBuilder.CreateIndex(
name: "IX_Skins_ImageId",
table: "Skins",
column: "ImageId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CategorieRunes");
migrationBuilder.DropTable(
name: "Skills");
migrationBuilder.DropTable(
name: "Skins");
migrationBuilder.DropTable(
name: "PageRunes");
migrationBuilder.DropTable(
name: "Runes");
migrationBuilder.DropTable(
name: "Champions");
migrationBuilder.DropTable(
name: "Images");
}
}
}