|
|
|
@ -0,0 +1,63 @@
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace EntityFramework.Migrations
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public partial class SkillMigration : 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)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Champion", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Skill",
|
|
|
|
|
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_Skill", x => x.Name);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_Skill_Champion_ChampionEntityId",
|
|
|
|
|
column: x => x.ChampionEntityId,
|
|
|
|
|
principalTable: "Champion",
|
|
|
|
|
principalColumn: "Id");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_Skill_ChampionEntityId",
|
|
|
|
|
table: "Skill",
|
|
|
|
|
column: "ChampionEntityId");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Skill");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Champion");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|