1
0
mirror of synced 2024-11-24 06:50:15 +01:00
TaikoLocalServer/GameDatabase/Migrations/20220828101620_AddDanDbTest.cs
2023-09-09 21:58:20 +09:00

80 lines
3.6 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TaikoLocalServer.Migrations
{
/// <inheritdoc />
public partial class AddDanDbTest : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DanScoreData",
columns: table => new
{
Baid = table.Column<uint>(type: "INTEGER", nullable: false),
DanId = table.Column<uint>(type: "INTEGER", nullable: false),
ArrivalSongCount = table.Column<uint>(type: "INTEGER", nullable: false),
SoulGaugeTotal = table.Column<uint>(type: "INTEGER", nullable: false),
ComboCountTotal = table.Column<uint>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DanScoreData", x => new { x.Baid, x.DanId });
table.UniqueConstraint("AK_DanScoreData_Baid", x => x.Baid);
table.ForeignKey(
name: "FK_DanScoreData_Card_Baid",
column: x => x.Baid,
principalTable: "Card",
principalColumn: "Baid",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DanStageScoreData",
columns: table => new
{
Baid = table.Column<uint>(type: "INTEGER", nullable: false),
DanId = table.Column<uint>(type: "INTEGER", nullable: false),
SongNumber = table.Column<uint>(type: "INTEGER", nullable: false),
PlayScore = table.Column<uint>(type: "INTEGER", nullable: false),
GoodCount = table.Column<uint>(type: "INTEGER", nullable: false),
OkCount = table.Column<uint>(type: "INTEGER", nullable: false),
BadCount = table.Column<uint>(type: "INTEGER", nullable: false),
DrumrollCount = table.Column<uint>(type: "INTEGER", nullable: false),
TotalHitCount = table.Column<uint>(type: "INTEGER", nullable: false),
ComboCount = table.Column<uint>(type: "INTEGER", nullable: false),
HighScore = table.Column<uint>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DanStageScoreData", x => new { x.Baid, x.DanId, x.SongNumber });
table.ForeignKey(
name: "FK_DanStageScoreData_DanScoreData_Baid",
column: x => x.Baid,
principalTable: "DanScoreData",
principalColumn: "Baid",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DanStageScoreData_DanScoreData_Baid_DanId",
columns: x => new { x.Baid, x.DanId },
principalTable: "DanScoreData",
principalColumns: new[] { "Baid", "DanId" },
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DanStageScoreData");
migrationBuilder.DropTable(
name: "DanScoreData");
}
}
}