|
|
|
@ -1,341 +0,0 @@
|
|
|
|
|
using System;
|
|
|
|
|
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: "largeimages",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
|
|
|
Base64 = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_largeimages", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "runepages",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_runepages", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "skills",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
|
|
|
|
SkillType = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_skills", x => x.Name);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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),
|
|
|
|
|
ImageId = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_champions", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_champions_largeimages_ImageId",
|
|
|
|
|
column: x => x.ImageId,
|
|
|
|
|
principalTable: "largeimages",
|
|
|
|
|
principalColumn: "Id");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "runes",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
|
|
|
|
|
RuneFamily = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
ImageId = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_runes", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_runes_largeimages_ImageId",
|
|
|
|
|
column: x => x.ImageId,
|
|
|
|
|
principalTable: "largeimages",
|
|
|
|
|
principalColumn: "Id");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "ChampionEntityRunePageEntity",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
championsName = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
runepagesId = table.Column<Guid>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_ChampionEntityRunePageEntity", x => new { x.championsName, x.runepagesId });
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_ChampionEntityRunePageEntity_champions_championsName",
|
|
|
|
|
column: x => x.championsName,
|
|
|
|
|
principalTable: "champions",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_ChampionEntityRunePageEntity_runepages_runepagesId",
|
|
|
|
|
column: x => x.runepagesId,
|
|
|
|
|
principalTable: "runepages",
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "ChampionEntitySkillEntity",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
ChampionsName = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
SkillsName = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_ChampionEntitySkillEntity", x => new { x.ChampionsName, x.SkillsName });
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_ChampionEntitySkillEntity_champions_ChampionsName",
|
|
|
|
|
column: x => x.ChampionsName,
|
|
|
|
|
principalTable: "champions",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_ChampionEntitySkillEntity_skills_SkillsName",
|
|
|
|
|
column: x => x.SkillsName,
|
|
|
|
|
principalTable: "skills",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "characteristics",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false),
|
|
|
|
|
ChampionForeignKey = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Value = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_characteristics", x => new { x.Name, x.ChampionForeignKey });
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_characteristics_champions_ChampionForeignKey",
|
|
|
|
|
column: x => x.ChampionForeignKey,
|
|
|
|
|
principalTable: "champions",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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),
|
|
|
|
|
ImageId = table.Column<Guid>(type: "TEXT", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
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);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_skins_largeimages_ImageId",
|
|
|
|
|
column: x => x.ImageId,
|
|
|
|
|
principalTable: "largeimages",
|
|
|
|
|
principalColumn: "Id");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "RunePageRuneEntity",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
runepagesId = table.Column<Guid>(type: "TEXT", nullable: false),
|
|
|
|
|
runesName = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Category = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_RunePageRuneEntity", x => new { x.runepagesId, x.runesName });
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_RunePageRuneEntity_runepages_runepagesId",
|
|
|
|
|
column: x => x.runepagesId,
|
|
|
|
|
principalTable: "runepages",
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_RunePageRuneEntity_runes_runesName",
|
|
|
|
|
column: x => x.runesName,
|
|
|
|
|
principalTable: "runes",
|
|
|
|
|
principalColumn: "Name",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "champions",
|
|
|
|
|
columns: new[] { "Name", "Bio", "Class", "Icon", "ImageId" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Armure", "Solide", 6, null, null },
|
|
|
|
|
{ "Dave", "Le meilleur Jazzman de France", 2, null, null }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "largeimages",
|
|
|
|
|
columns: new[] { "Id", "Base64" },
|
|
|
|
|
values: new object[] { new Guid("d3a490c6-fb49-475a-9134-47c2de9888d2"), "aaa" });
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "runepages",
|
|
|
|
|
columns: new[] { "Id", "Name" },
|
|
|
|
|
values: new object[] { new Guid("4ea04d4f-0a64-4d28-8d74-4499dbc541f2"), "Runepage_1" });
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "runes",
|
|
|
|
|
columns: new[] { "Name", "Description", "ImageId", "RuneFamily" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Alkatraz", "Lock effect", null, 2 },
|
|
|
|
|
{ "Bullseye", "Steady shot", null, 1 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "skills",
|
|
|
|
|
columns: new[] { "Name", "Description", "SkillType" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Boule de feu", "Fire!", 1 },
|
|
|
|
|
{ "White Star", "Random damage", 3 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "characteristics",
|
|
|
|
|
columns: new[] { "ChampionForeignKey", "Name", "Value" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Armure", "Défense", 75 },
|
|
|
|
|
{ "Dave", "Force", 50 }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "skins",
|
|
|
|
|
columns: new[] { "Name", "ChampionForeignKey", "Description", "Icon", "ImageId", "Price" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ "Armure Fullspeed", "Armure", "Deja vu", "aaa", null, 9.99f },
|
|
|
|
|
{ "Dave de glace", "Dave", "Enneigé", "aaa", null, 7.99f }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_ChampionEntityRunePageEntity_runepagesId",
|
|
|
|
|
table: "ChampionEntityRunePageEntity",
|
|
|
|
|
column: "runepagesId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_ChampionEntitySkillEntity_SkillsName",
|
|
|
|
|
table: "ChampionEntitySkillEntity",
|
|
|
|
|
column: "SkillsName");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_champions_ImageId",
|
|
|
|
|
table: "champions",
|
|
|
|
|
column: "ImageId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_characteristics_ChampionForeignKey",
|
|
|
|
|
table: "characteristics",
|
|
|
|
|
column: "ChampionForeignKey");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_RunePageRuneEntity_runesName",
|
|
|
|
|
table: "RunePageRuneEntity",
|
|
|
|
|
column: "runesName");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_runes_ImageId",
|
|
|
|
|
table: "runes",
|
|
|
|
|
column: "ImageId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_skins_ChampionForeignKey",
|
|
|
|
|
table: "skins",
|
|
|
|
|
column: "ChampionForeignKey");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_skins_ImageId",
|
|
|
|
|
table: "skins",
|
|
|
|
|
column: "ImageId");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "ChampionEntityRunePageEntity");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "ChampionEntitySkillEntity");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "characteristics");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "RunePageRuneEntity");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "skins");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "skills");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "runepages");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "runes");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "champions");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "largeimages");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|