|
|
|
@ -0,0 +1,121 @@
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
|
|
|
|
|
|
namespace EntityFramework.Migrations.Stubbed
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class MyMigr : Migration
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Champion",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
|
|
|
|
|
Bio = table.Column<string>(type: "string", maxLength: 500, nullable: false),
|
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Image = table.Column<string>(type: "TEXT", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Champion", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Image",
|
|
|
|
|
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_Image", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "SkillEntity",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
ChampionEntityId = table.Column<int>(type: "INTEGER", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_SkillEntity", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_SkillEntity_Champion_ChampionEntityId",
|
|
|
|
|
column: x => x.ChampionEntityId,
|
|
|
|
|
principalTable: "Champion",
|
|
|
|
|
principalColumn: "Id");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Skins",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", nullable: true),
|
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
Image = table.Column<string>(type: "TEXT", nullable: true),
|
|
|
|
|
Price = table.Column<float>(type: "REAL", nullable: false),
|
|
|
|
|
ChampionEntityForeignKey = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Skins", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_Skins_Champion_ChampionEntityForeignKey",
|
|
|
|
|
column: x => x.ChampionEntityForeignKey,
|
|
|
|
|
principalTable: "Champion",
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.InsertData(
|
|
|
|
|
table: "Champion",
|
|
|
|
|
columns: new[] { "Id", "Bio", "Icon", "Image", "Name" },
|
|
|
|
|
values: new object[,]
|
|
|
|
|
{
|
|
|
|
|
{ -96935452, "mimimimimim", "/small.png", null, "Pintrand" },
|
|
|
|
|
{ 1673124670, "biobiobiobio", "/a/a/a/a", null, "Corichard" }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_SkillEntity_ChampionEntityId",
|
|
|
|
|
table: "SkillEntity",
|
|
|
|
|
column: "ChampionEntityId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_Skins_ChampionEntityForeignKey",
|
|
|
|
|
table: "Skins",
|
|
|
|
|
column: "ChampionEntityForeignKey");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Image");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "SkillEntity");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Skins");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Champion");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|