mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Fix all remaining db structure issues
This commit is contained in:
@ -10,7 +10,7 @@ using System;
|
||||
namespace osu.Game.Migrations
|
||||
{
|
||||
[DbContext(typeof(OsuDbContext))]
|
||||
[Migration("20171018125509_InitialCreate")]
|
||||
[Migration("20171019041408_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -26,8 +26,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<float>("ApproachRate");
|
||||
|
||||
b.Property<int>("BeatmapInfoID");
|
||||
|
||||
b.Property<float>("CircleSize");
|
||||
|
||||
b.Property<float>("DrainRate");
|
||||
@ -40,9 +38,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BeatmapInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("BeatmapDifficulty");
|
||||
});
|
||||
|
||||
@ -73,6 +68,10 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("MD5Hash");
|
||||
|
||||
b.Property<int?>("MetadataID");
|
||||
|
||||
b.Property<int?>("OnlineBeatmapID");
|
||||
|
||||
b.Property<string>("Path");
|
||||
|
||||
b.Property<int>("RulesetID");
|
||||
@ -93,12 +92,16 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BaseDifficultyID");
|
||||
|
||||
b.HasIndex("BeatmapSetInfoID");
|
||||
|
||||
b.HasIndex("Hash");
|
||||
|
||||
b.HasIndex("MD5Hash");
|
||||
|
||||
b.HasIndex("MetadataID");
|
||||
|
||||
b.HasIndex("RulesetID");
|
||||
|
||||
b.ToTable("BeatmapInfo");
|
||||
@ -120,10 +123,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("BackgroundFile");
|
||||
|
||||
b.Property<int?>("BeatmapInfoID");
|
||||
|
||||
b.Property<int?>("BeatmapSetInfoID");
|
||||
|
||||
b.Property<int>("PreviewTime");
|
||||
|
||||
b.Property<string>("Source");
|
||||
@ -136,12 +135,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BeatmapInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("BeatmapSetInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("BeatmapMetadata");
|
||||
});
|
||||
|
||||
@ -175,6 +168,8 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("Hash");
|
||||
|
||||
b.Property<int?>("MetadataID");
|
||||
|
||||
b.Property<int?>("OnlineBeatmapSetID");
|
||||
|
||||
b.Property<bool>("Protected");
|
||||
@ -185,6 +180,8 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasIndex("Hash");
|
||||
|
||||
b.HasIndex("MetadataID");
|
||||
|
||||
b.ToTable("BeatmapSetInfo");
|
||||
});
|
||||
|
||||
@ -246,49 +243,31 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasIndex("Available");
|
||||
|
||||
b.HasIndex("InstantiationInfo")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("RulesetInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapInfo")
|
||||
.WithOne("Difficulty")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapDifficulty", "BeatmapInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty")
|
||||
.WithMany()
|
||||
.HasForeignKey("BaseDifficultyID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet")
|
||||
.WithMany("Beatmaps")
|
||||
.HasForeignKey("BeatmapSetInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
|
||||
.WithMany("Beatmaps")
|
||||
.HasForeignKey("MetadataID");
|
||||
|
||||
b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset")
|
||||
.WithMany()
|
||||
.HasForeignKey("RulesetID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapInfo", "BeatmapInfo")
|
||||
.WithOne("Metadata")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapMetadata", "BeatmapInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSetInfo")
|
||||
.WithOne("Metadata")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapMetadata", "BeatmapSetInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo")
|
||||
@ -301,6 +280,13 @@ namespace osu.Game.Migrations
|
||||
.HasForeignKey("FileInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
|
||||
.WithMany("BeatmapSets")
|
||||
.HasForeignKey("MetadataID");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
@ -9,19 +9,43 @@ namespace osu.Game.Migrations
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapSetInfo",
|
||||
name: "BeatmapDifficulty",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
DeletePending = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OnlineBeatmapSetID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Protected = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
ApproachRate = table.Column<float>(type: "REAL", nullable: false),
|
||||
CircleSize = table.Column<float>(type: "REAL", nullable: false),
|
||||
DrainRate = table.Column<float>(type: "REAL", nullable: false),
|
||||
OverallDifficulty = table.Column<float>(type: "REAL", nullable: false),
|
||||
SliderMultiplier = table.Column<float>(type: "REAL", nullable: false),
|
||||
SliderTickRate = table.Column<float>(type: "REAL", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapSetInfo", x => x.ID);
|
||||
table.PrimaryKey("PK_BeatmapDifficulty", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapMetadata",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Artist = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ArtistUnicode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
AudioFile = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Author = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BackgroundFile = table.Column<string>(type: "TEXT", nullable: true),
|
||||
PreviewTime = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Source = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Tags = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Title = table.Column<string>(type: "TEXT", nullable: true),
|
||||
TitleUnicode = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapMetadata", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@ -69,6 +93,87 @@ namespace osu.Game.Migrations
|
||||
table.PrimaryKey("PK_RulesetInfo", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapSetInfo",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
DeletePending = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
MetadataID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
OnlineBeatmapSetID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Protected = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapSetInfo", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapSetInfo_BeatmapMetadata_MetadataID",
|
||||
column: x => x.MetadataID,
|
||||
principalTable: "BeatmapMetadata",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapInfo",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
AudioLeadIn = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BaseDifficultyID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BeatDivisor = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BeatmapSetInfoID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Countdown = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
DistanceSpacing = table.Column<double>(type: "REAL", nullable: false),
|
||||
GridSize = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Hidden = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
LetterboxInBreaks = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
MD5Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
MetadataID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
OnlineBeatmapID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Path = table.Column<string>(type: "TEXT", nullable: true),
|
||||
RulesetID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
SpecialStyle = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
StackLeniency = table.Column<float>(type: "REAL", nullable: false),
|
||||
StarDifficulty = table.Column<double>(type: "REAL", nullable: false),
|
||||
StoredBookmarks = table.Column<string>(type: "TEXT", nullable: true),
|
||||
TimelineZoom = table.Column<double>(type: "REAL", nullable: false),
|
||||
Version = table.Column<string>(type: "TEXT", nullable: true),
|
||||
WidescreenStoryboard = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapInfo", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_BeatmapDifficulty_BaseDifficultyID",
|
||||
column: x => x.BaseDifficultyID,
|
||||
principalTable: "BeatmapDifficulty",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_BeatmapSetInfo_BeatmapSetInfoID",
|
||||
column: x => x.BeatmapSetInfoID,
|
||||
principalTable: "BeatmapSetInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_BeatmapMetadata_MetadataID",
|
||||
column: x => x.MetadataID,
|
||||
principalTable: "BeatmapMetadata",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_RulesetInfo_RulesetID",
|
||||
column: x => x.RulesetID,
|
||||
principalTable: "RulesetInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapSetFileInfo",
|
||||
columns: table => new
|
||||
@ -96,116 +201,10 @@ namespace osu.Game.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapInfo",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
AudioLeadIn = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BaseDifficultyID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BeatDivisor = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
BeatmapSetInfoID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Countdown = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
DistanceSpacing = table.Column<double>(type: "REAL", nullable: false),
|
||||
GridSize = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Hidden = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
LetterboxInBreaks = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
MD5Hash = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Path = table.Column<string>(type: "TEXT", nullable: true),
|
||||
RulesetID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
SpecialStyle = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
StackLeniency = table.Column<float>(type: "REAL", nullable: false),
|
||||
StarDifficulty = table.Column<double>(type: "REAL", nullable: false),
|
||||
StoredBookmarks = table.Column<string>(type: "TEXT", nullable: true),
|
||||
TimelineZoom = table.Column<double>(type: "REAL", nullable: false),
|
||||
Version = table.Column<string>(type: "TEXT", nullable: true),
|
||||
WidescreenStoryboard = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapInfo", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_BeatmapSetInfo_BeatmapSetInfoID",
|
||||
column: x => x.BeatmapSetInfoID,
|
||||
principalTable: "BeatmapSetInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapInfo_RulesetInfo_RulesetID",
|
||||
column: x => x.RulesetID,
|
||||
principalTable: "RulesetInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapDifficulty",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ApproachRate = table.Column<float>(type: "REAL", nullable: false),
|
||||
BeatmapInfoID = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
CircleSize = table.Column<float>(type: "REAL", nullable: false),
|
||||
DrainRate = table.Column<float>(type: "REAL", nullable: false),
|
||||
OverallDifficulty = table.Column<float>(type: "REAL", nullable: false),
|
||||
SliderMultiplier = table.Column<float>(type: "REAL", nullable: false),
|
||||
SliderTickRate = table.Column<float>(type: "REAL", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapDifficulty", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapDifficulty_BeatmapInfo_BeatmapInfoID",
|
||||
column: x => x.BeatmapInfoID,
|
||||
principalTable: "BeatmapInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BeatmapMetadata",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Artist = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ArtistUnicode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
AudioFile = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Author = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BackgroundFile = table.Column<string>(type: "TEXT", nullable: true),
|
||||
BeatmapInfoID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
BeatmapSetInfoID = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
PreviewTime = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Source = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Tags = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Title = table.Column<string>(type: "TEXT", nullable: true),
|
||||
TitleUnicode = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BeatmapMetadata", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapMetadata_BeatmapInfo_BeatmapInfoID",
|
||||
column: x => x.BeatmapInfoID,
|
||||
principalTable: "BeatmapInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BeatmapMetadata_BeatmapSetInfo_BeatmapSetInfoID",
|
||||
column: x => x.BeatmapSetInfoID,
|
||||
principalTable: "BeatmapSetInfo",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapDifficulty_BeatmapInfoID",
|
||||
table: "BeatmapDifficulty",
|
||||
column: "BeatmapInfoID",
|
||||
unique: true);
|
||||
name: "IX_BeatmapInfo_BaseDifficultyID",
|
||||
table: "BeatmapInfo",
|
||||
column: "BaseDifficultyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapInfo_BeatmapSetInfoID",
|
||||
@ -222,23 +221,16 @@ namespace osu.Game.Migrations
|
||||
table: "BeatmapInfo",
|
||||
column: "MD5Hash");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapInfo_MetadataID",
|
||||
table: "BeatmapInfo",
|
||||
column: "MetadataID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapInfo_RulesetID",
|
||||
table: "BeatmapInfo",
|
||||
column: "RulesetID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapMetadata_BeatmapInfoID",
|
||||
table: "BeatmapMetadata",
|
||||
column: "BeatmapInfoID",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapMetadata_BeatmapSetInfoID",
|
||||
table: "BeatmapMetadata",
|
||||
column: "BeatmapSetInfoID",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapSetFileInfo_BeatmapSetInfoID",
|
||||
table: "BeatmapSetFileInfo",
|
||||
@ -259,6 +251,11 @@ namespace osu.Game.Migrations
|
||||
table: "BeatmapSetInfo",
|
||||
column: "Hash");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BeatmapSetInfo_MetadataID",
|
||||
table: "BeatmapSetInfo",
|
||||
column: "MetadataID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FileInfo_Hash",
|
||||
table: "FileInfo",
|
||||
@ -284,27 +281,12 @@ namespace osu.Game.Migrations
|
||||
name: "IX_RulesetInfo_Available",
|
||||
table: "RulesetInfo",
|
||||
column: "Available");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RulesetInfo_InstantiationInfo",
|
||||
table: "RulesetInfo",
|
||||
column: "InstantiationInfo",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RulesetInfo_Name",
|
||||
table: "RulesetInfo",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapDifficulty");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapMetadata");
|
||||
name: "BeatmapInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapSetFileInfo");
|
||||
@ -313,16 +295,19 @@ namespace osu.Game.Migrations
|
||||
name: "KeyBinding");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapInfo");
|
||||
name: "BeatmapDifficulty");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "FileInfo");
|
||||
name: "RulesetInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapSetInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RulesetInfo");
|
||||
name: "FileInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BeatmapMetadata");
|
||||
}
|
||||
}
|
||||
}
|
@ -25,8 +25,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<float>("ApproachRate");
|
||||
|
||||
b.Property<int>("BeatmapInfoID");
|
||||
|
||||
b.Property<float>("CircleSize");
|
||||
|
||||
b.Property<float>("DrainRate");
|
||||
@ -39,9 +37,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BeatmapInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("BeatmapDifficulty");
|
||||
});
|
||||
|
||||
@ -72,6 +67,10 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("MD5Hash");
|
||||
|
||||
b.Property<int?>("MetadataID");
|
||||
|
||||
b.Property<int?>("OnlineBeatmapID");
|
||||
|
||||
b.Property<string>("Path");
|
||||
|
||||
b.Property<int>("RulesetID");
|
||||
@ -92,12 +91,16 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BaseDifficultyID");
|
||||
|
||||
b.HasIndex("BeatmapSetInfoID");
|
||||
|
||||
b.HasIndex("Hash");
|
||||
|
||||
b.HasIndex("MD5Hash");
|
||||
|
||||
b.HasIndex("MetadataID");
|
||||
|
||||
b.HasIndex("RulesetID");
|
||||
|
||||
b.ToTable("BeatmapInfo");
|
||||
@ -119,10 +122,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("BackgroundFile");
|
||||
|
||||
b.Property<int?>("BeatmapInfoID");
|
||||
|
||||
b.Property<int?>("BeatmapSetInfoID");
|
||||
|
||||
b.Property<int>("PreviewTime");
|
||||
|
||||
b.Property<string>("Source");
|
||||
@ -135,12 +134,6 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("BeatmapInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("BeatmapSetInfoID")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("BeatmapMetadata");
|
||||
});
|
||||
|
||||
@ -174,6 +167,8 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.Property<string>("Hash");
|
||||
|
||||
b.Property<int?>("MetadataID");
|
||||
|
||||
b.Property<int?>("OnlineBeatmapSetID");
|
||||
|
||||
b.Property<bool>("Protected");
|
||||
@ -184,6 +179,8 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasIndex("Hash");
|
||||
|
||||
b.HasIndex("MetadataID");
|
||||
|
||||
b.ToTable("BeatmapSetInfo");
|
||||
});
|
||||
|
||||
@ -245,49 +242,31 @@ namespace osu.Game.Migrations
|
||||
|
||||
b.HasIndex("Available");
|
||||
|
||||
b.HasIndex("InstantiationInfo")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("RulesetInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapInfo")
|
||||
.WithOne("Difficulty")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapDifficulty", "BeatmapInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty")
|
||||
.WithMany()
|
||||
.HasForeignKey("BaseDifficultyID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet")
|
||||
.WithMany("Beatmaps")
|
||||
.HasForeignKey("BeatmapSetInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
|
||||
.WithMany("Beatmaps")
|
||||
.HasForeignKey("MetadataID");
|
||||
|
||||
b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset")
|
||||
.WithMany()
|
||||
.HasForeignKey("RulesetID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapInfo", "BeatmapInfo")
|
||||
.WithOne("Metadata")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapMetadata", "BeatmapInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSetInfo")
|
||||
.WithOne("Metadata")
|
||||
.HasForeignKey("osu.Game.Beatmaps.BeatmapMetadata", "BeatmapSetInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo")
|
||||
@ -300,6 +279,13 @@ namespace osu.Game.Migrations
|
||||
.HasForeignKey("FileInfoID")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
|
||||
{
|
||||
b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata")
|
||||
.WithMany("BeatmapSets")
|
||||
.HasForeignKey("MetadataID");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user