Fix all remaining db structure issues

This commit is contained in:
Dean Herbert
2017-10-19 14:05:11 +09:00
parent 71d614b813
commit 5d5ea5fb2e
34 changed files with 259 additions and 309 deletions

View File

@ -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
}
}