session-companion/SessionCompanion/SessionCompanion.Database/Migrations/20201218105527_Character Data Seed.cs

189 lines
5.9 KiB
C#
Raw Normal View History

2020-12-18 12:00:36 +01:00
using Microsoft.EntityFrameworkCore.Migrations;
namespace SessionCompanion.Database.Migrations
{
public partial class CharacterDataSeed : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Alignments",
column: "Id",
values: new object[]
{
1,
2,
3
});
migrationBuilder.InsertData(
table: "Backgrounds",
column: "Id",
values: new object[]
{
1,
2,
3
});
migrationBuilder.InsertData(
table: "Characters",
columns: new[] { "Id", "UserId" },
values: new object[,]
{
{ 1, 1 },
{ 2, 2 },
{ 3, 3 }
});
migrationBuilder.InsertData(
table: "Classes",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Warrior" },
{ 2, "Knight" },
{ 3, "Priest" }
});
migrationBuilder.InsertData(
table: "Races",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Human" },
{ 2, "Dwarf" },
{ 3, "Elf" }
});
migrationBuilder.InsertData(
table: "Biographies",
columns: new[] { "Id", "AlignmentId", "BackgroundId", "CharacterId", "ClassId", "Name", "RaceId", "Sex" },
values: new object[,]
{
{ 1, 1, 1, 1, 1, "Bob", 1, "Male" },
{ 2, 2, 2, 2, 2, "Queen Daenerys Stormborn of the House Targaryen, the First of Her Name, Queen of the Andals, the Rhoynar and the First Men, Lady of the Seven Kingdoms and Protector of the Realm, Lady of Dragonstone, Queen of Meereen, Khaleesi of the Great Grass Sea, the Unburnt, Breaker of Chains and Mother of Dragons.", 2, "Female" },
{ 3, 3, 3, 3, 3, "Gandalf the White", 3, "Both" }
});
migrationBuilder.InsertData(
table: "Statistics",
columns: new[] { "Id", "ArmorClass", "CharacterId", "CurrentHealthPoints", "ExperiencePoints", "HealthPoints", "Initiative", "Level", "Proficiency", "Speed" },
values: new object[,]
{
{ 1, 9, 1, 18, 2, 20, 12, 1, 1, 5 },
{ 2, 12, 2, 26, 0, 26, 7, 1, 1, 10 },
{ 3, 2, 3, 7, 24, 7, 18, 1, 2, 15 }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Biographies",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Biographies",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Biographies",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Statistics",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Statistics",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Statistics",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Alignments",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Alignments",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Alignments",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Backgrounds",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Backgrounds",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Backgrounds",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Characters",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Characters",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Characters",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Classes",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Classes",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Classes",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "Races",
keyColumn: "Id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "Races",
keyColumn: "Id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "Races",
keyColumn: "Id",
keyValue: 3);
}
}
}