|
|
@ -10,6 +10,19 @@ namespace EntityFramwork.Migrations
|
|
|
|
/// <inheritdoc />
|
|
|
|
/// <inheritdoc />
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
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(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "Champions",
|
|
|
|
name: "Champions",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
@ -18,24 +31,40 @@ namespace EntityFramwork.Migrations
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
Name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Bio = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Bio = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
|
|
|
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_Champions", x => x.Id);
|
|
|
|
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(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
name: "Images",
|
|
|
|
name: "Runes",
|
|
|
|
columns: table => new
|
|
|
|
columns: table => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Id = table.Column<long>(type: "INTEGER", nullable: false)
|
|
|
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
|
|
Base64 = table.Column<string>(type: "TEXT", nullable: false)
|
|
|
|
Name = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
|
|
|
Description = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
|
|
|
|
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_Images", x => x.Id);
|
|
|
|
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(
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
@ -47,19 +76,32 @@ namespace EntityFramwork.Migrations
|
|
|
|
Description = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Description = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Icon = table.Column<string>(type: "TEXT", nullable: false),
|
|
|
|
Price = table.Column<float>(type: "REAL", nullable: false),
|
|
|
|
Price = table.Column<float>(type: "REAL", nullable: false),
|
|
|
|
ChampionId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
ChampionForeignKey = table.Column<int>(type: "INTEGER", nullable: false),
|
|
|
|
|
|
|
|
ImageId = table.Column<int>(type: "INTEGER", nullable: false)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
constraints: table =>
|
|
|
|
constraints: table =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
table.PrimaryKey("PK_Skins", x => x.Id);
|
|
|
|
table.PrimaryKey("PK_Skins", x => x.Id);
|
|
|
|
table.ForeignKey(
|
|
|
|
table.ForeignKey(
|
|
|
|
name: "FK_Skins_Champions_ChampionId",
|
|
|
|
name: "FK_Skins_Champions_ChampionForeignKey",
|
|
|
|
column: x => x.ChampionId,
|
|
|
|
column: x => x.ChampionForeignKey,
|
|
|
|
principalTable: "Champions",
|
|
|
|
principalTable: "Champions",
|
|
|
|
principalColumn: "Id",
|
|
|
|
principalColumn: "Id",
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
|
|
|
name: "FK_Skins_Images_ImageId",
|
|
|
|
|
|
|
|
column: x => x.ImageId,
|
|
|
|
|
|
|
|
principalTable: "Images",
|
|
|
|
|
|
|
|
principalColumn: "Id",
|
|
|
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
|
|
|
name: "IX_Champions_ImageId",
|
|
|
|
|
|
|
|
table: "Champions",
|
|
|
|
|
|
|
|
column: "ImageId",
|
|
|
|
|
|
|
|
unique: true);
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_Champions_Name",
|
|
|
|
name: "IX_Champions_Name",
|
|
|
|
table: "Champions",
|
|
|
|
table: "Champions",
|
|
|
@ -67,22 +109,37 @@ namespace EntityFramwork.Migrations
|
|
|
|
unique: true);
|
|
|
|
unique: true);
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
name: "IX_Skins_ChampionId",
|
|
|
|
name: "IX_Runes_ImageId",
|
|
|
|
|
|
|
|
table: "Runes",
|
|
|
|
|
|
|
|
column: "ImageId",
|
|
|
|
|
|
|
|
unique: true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
|
|
|
name: "IX_Skins_ChampionForeignKey",
|
|
|
|
|
|
|
|
table: "Skins",
|
|
|
|
|
|
|
|
column: "ChampionForeignKey");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
|
|
|
name: "IX_Skins_ImageId",
|
|
|
|
table: "Skins",
|
|
|
|
table: "Skins",
|
|
|
|
column: "ChampionId");
|
|
|
|
column: "ImageId",
|
|
|
|
|
|
|
|
unique: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
/// <inheritdoc />
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "Images");
|
|
|
|
name: "Runes");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "Skins");
|
|
|
|
name: "Skins");
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
name: "Champions");
|
|
|
|
name: "Champions");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
|
|
|
name: "Images");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|