1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Fix BeatmapMetadata removing

This commit is contained in:
TocoToucan 2017-10-10 00:17:12 +03:00
parent ef417c6388
commit cbae19b604
6 changed files with 904 additions and 4 deletions

View File

@ -14,6 +14,7 @@ namespace osu.Game.Beatmaps
[NotMapped]
public int? BeatmapSetOnlineInfoId { get; set; }
public int BeatmapSetInfoId { get; set; }
public string Title { get; set; }
public string TitleUnicode { get; set; }

View File

@ -0,0 +1,292 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using osu.Game.Database;
using System;
namespace osu.Game.Migrations
{
[DbContext(typeof(OsuDbContext))]
[Migration("20171009205048_Init")]
partial class Init
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<float>("ApproachRate");
b.Property<float>("CircleSize");
b.Property<float>("DrainRate");
b.Property<float>("OverallDifficulty");
b.Property<float>("SliderMultiplier");
b.Property<float>("SliderTickRate");
b.HasKey("Id");
b.ToTable("BeatmapDifficulty");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AudioLeadIn");
b.Property<int>("BeatDivisor");
b.Property<int>("BeatmapDifficultyId");
b.Property<int>("BeatmapSetInfoId");
b.Property<bool>("Countdown");
b.Property<double>("DistanceSpacing");
b.Property<int>("GridSize");
b.Property<string>("Hash");
b.Property<bool>("Hidden");
b.Property<bool>("LetterboxInBreaks");
b.Property<string>("MD5Hash");
b.Property<int?>("MetadataId");
b.Property<string>("Path");
b.Property<int>("RulesetInfoId");
b.Property<bool>("SpecialStyle");
b.Property<float>("StackLeniency");
b.Property<double>("StarDifficulty");
b.Property<string>("StoredBookmarks");
b.Property<double>("TimelineZoom");
b.Property<string>("Version");
b.Property<bool>("WidescreenStoryboard");
b.HasKey("Id");
b.HasIndex("BeatmapDifficultyId");
b.HasIndex("BeatmapSetInfoId");
b.HasIndex("MD5Hash");
b.HasIndex("MetadataId");
b.HasIndex("RulesetInfoId");
b.ToTable("BeatmapInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Artist");
b.Property<string>("ArtistUnicode");
b.Property<string>("AudioFile");
b.Property<string>("Author");
b.Property<string>("BackgroundFile");
b.Property<int>("BeatmapSetInfoId");
b.Property<int>("PreviewTime");
b.Property<string>("Source");
b.Property<string>("Tags");
b.Property<string>("Title");
b.Property<string>("TitleUnicode");
b.HasKey("Id");
b.HasIndex("BeatmapSetInfoId")
.IsUnique();
b.ToTable("BeatmapMetadata");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("BeatmapSetInfoId");
b.Property<int>("FileInfoId");
b.Property<string>("Filename")
.IsRequired();
b.HasKey("Id");
b.HasIndex("BeatmapSetInfoId");
b.HasIndex("FileInfoId");
b.ToTable("BeatmapSetFileInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("DeletePending");
b.Property<string>("Hash");
b.Property<bool>("Protected");
b.HasKey("Id");
b.HasIndex("DeletePending");
b.ToTable("BeatmapSetInfo");
});
modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("IntAction")
.HasColumnName("Action");
b.Property<string>("KeysString")
.HasColumnName("Keys");
b.Property<int?>("RulesetInfoId");
b.Property<int?>("Variant");
b.HasKey("Id");
b.HasIndex("IntAction");
b.HasIndex("Variant");
b.ToTable("KeyBinding");
});
modelBuilder.Entity("osu.Game.IO.FileInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Hash");
b.Property<int>("ReferenceCount");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("ReferenceCount");
b.ToTable("FileInfo");
});
modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b =>
{
b.Property<int?>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("Available");
b.Property<string>("InstantiationInfo");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("Available");
b.HasIndex("InstantiationInfo")
.IsUnique();
b.HasIndex("Name")
.IsUnique();
b.ToTable("RulesetInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "Difficulty")
.WithMany()
.HasForeignKey("BeatmapDifficultyId")
.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()
.HasForeignKey("MetadataId");
b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset")
.WithMany()
.HasForeignKey("RulesetInfoId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
{
b.HasOne("osu.Game.Beatmaps.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")
.WithMany("Files")
.HasForeignKey("BeatmapSetInfoId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("osu.Game.IO.FileInfo", "FileInfo")
.WithMany()
.HasForeignKey("FileInfoId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,314 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace osu.Game.Migrations
{
public partial class Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
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),
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);
});
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),
Protected = table.Column<bool>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BeatmapSetInfo", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FileInfo",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Hash = table.Column<string>(type: "TEXT", nullable: true),
ReferenceCount = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FileInfo", x => x.Id);
});
migrationBuilder.CreateTable(
name: "KeyBinding",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Action = table.Column<int>(type: "INTEGER", nullable: false),
Keys = table.Column<string>(type: "TEXT", nullable: true),
RulesetInfoId = table.Column<int>(type: "INTEGER", nullable: true),
Variant = table.Column<int>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_KeyBinding", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RulesetInfo",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Available = table.Column<bool>(type: "INTEGER", nullable: false),
InstantiationInfo = table.Column<string>(type: "TEXT", nullable: true),
Name = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RulesetInfo", 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),
BeatmapSetInfoId = table.Column<int>(type: "INTEGER", nullable: false),
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_BeatmapSetInfo_BeatmapSetInfoId",
column: x => x.BeatmapSetInfoId,
principalTable: "BeatmapSetInfo",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "BeatmapSetFileInfo",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
BeatmapSetInfoId = table.Column<int>(type: "INTEGER", nullable: false),
FileInfoId = table.Column<int>(type: "INTEGER", nullable: false),
Filename = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BeatmapSetFileInfo", x => x.Id);
table.ForeignKey(
name: "FK_BeatmapSetFileInfo_BeatmapSetInfo_BeatmapSetInfoId",
column: x => x.BeatmapSetInfoId,
principalTable: "BeatmapSetInfo",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BeatmapSetFileInfo_FileInfo_FileInfoId",
column: x => x.FileInfoId,
principalTable: "FileInfo",
principalColumn: "Id",
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),
BeatDivisor = table.Column<int>(type: "INTEGER", nullable: false),
BeatmapDifficultyId = 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),
Path = table.Column<string>(type: "TEXT", nullable: true),
RulesetInfoId = 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_BeatmapDifficultyId",
column: x => x.BeatmapDifficultyId,
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_RulesetInfoId",
column: x => x.RulesetInfoId,
principalTable: "RulesetInfo",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_BeatmapDifficultyId",
table: "BeatmapInfo",
column: "BeatmapDifficultyId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_BeatmapSetInfoId",
table: "BeatmapInfo",
column: "BeatmapSetInfoId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_MD5Hash",
table: "BeatmapInfo",
column: "MD5Hash");
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_MetadataId",
table: "BeatmapInfo",
column: "MetadataId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapInfo_RulesetInfoId",
table: "BeatmapInfo",
column: "RulesetInfoId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapMetadata_BeatmapSetInfoId",
table: "BeatmapMetadata",
column: "BeatmapSetInfoId",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_BeatmapSetFileInfo_BeatmapSetInfoId",
table: "BeatmapSetFileInfo",
column: "BeatmapSetInfoId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapSetFileInfo_FileInfoId",
table: "BeatmapSetFileInfo",
column: "FileInfoId");
migrationBuilder.CreateIndex(
name: "IX_BeatmapSetInfo_DeletePending",
table: "BeatmapSetInfo",
column: "DeletePending");
migrationBuilder.CreateIndex(
name: "IX_FileInfo_Hash",
table: "FileInfo",
column: "Hash",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_FileInfo_ReferenceCount",
table: "FileInfo",
column: "ReferenceCount");
migrationBuilder.CreateIndex(
name: "IX_KeyBinding_Action",
table: "KeyBinding",
column: "Action");
migrationBuilder.CreateIndex(
name: "IX_KeyBinding_Variant",
table: "KeyBinding",
column: "Variant");
migrationBuilder.CreateIndex(
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: "BeatmapInfo");
migrationBuilder.DropTable(
name: "BeatmapSetFileInfo");
migrationBuilder.DropTable(
name: "KeyBinding");
migrationBuilder.DropTable(
name: "BeatmapDifficulty");
migrationBuilder.DropTable(
name: "BeatmapMetadata");
migrationBuilder.DropTable(
name: "RulesetInfo");
migrationBuilder.DropTable(
name: "FileInfo");
migrationBuilder.DropTable(
name: "BeatmapSetInfo");
}
}
}

View File

@ -0,0 +1,291 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using osu.Game.Database;
using System;
namespace osu.Game.Migrations
{
[DbContext(typeof(OsuDbContext))]
partial class OsuDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<float>("ApproachRate");
b.Property<float>("CircleSize");
b.Property<float>("DrainRate");
b.Property<float>("OverallDifficulty");
b.Property<float>("SliderMultiplier");
b.Property<float>("SliderTickRate");
b.HasKey("Id");
b.ToTable("BeatmapDifficulty");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AudioLeadIn");
b.Property<int>("BeatDivisor");
b.Property<int>("BeatmapDifficultyId");
b.Property<int>("BeatmapSetInfoId");
b.Property<bool>("Countdown");
b.Property<double>("DistanceSpacing");
b.Property<int>("GridSize");
b.Property<string>("Hash");
b.Property<bool>("Hidden");
b.Property<bool>("LetterboxInBreaks");
b.Property<string>("MD5Hash");
b.Property<int?>("MetadataId");
b.Property<string>("Path");
b.Property<int>("RulesetInfoId");
b.Property<bool>("SpecialStyle");
b.Property<float>("StackLeniency");
b.Property<double>("StarDifficulty");
b.Property<string>("StoredBookmarks");
b.Property<double>("TimelineZoom");
b.Property<string>("Version");
b.Property<bool>("WidescreenStoryboard");
b.HasKey("Id");
b.HasIndex("BeatmapDifficultyId");
b.HasIndex("BeatmapSetInfoId");
b.HasIndex("MD5Hash");
b.HasIndex("MetadataId");
b.HasIndex("RulesetInfoId");
b.ToTable("BeatmapInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Artist");
b.Property<string>("ArtistUnicode");
b.Property<string>("AudioFile");
b.Property<string>("Author");
b.Property<string>("BackgroundFile");
b.Property<int>("BeatmapSetInfoId");
b.Property<int>("PreviewTime");
b.Property<string>("Source");
b.Property<string>("Tags");
b.Property<string>("Title");
b.Property<string>("TitleUnicode");
b.HasKey("Id");
b.HasIndex("BeatmapSetInfoId")
.IsUnique();
b.ToTable("BeatmapMetadata");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("BeatmapSetInfoId");
b.Property<int>("FileInfoId");
b.Property<string>("Filename")
.IsRequired();
b.HasKey("Id");
b.HasIndex("BeatmapSetInfoId");
b.HasIndex("FileInfoId");
b.ToTable("BeatmapSetFileInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("DeletePending");
b.Property<string>("Hash");
b.Property<bool>("Protected");
b.HasKey("Id");
b.HasIndex("DeletePending");
b.ToTable("BeatmapSetInfo");
});
modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("IntAction")
.HasColumnName("Action");
b.Property<string>("KeysString")
.HasColumnName("Keys");
b.Property<int?>("RulesetInfoId");
b.Property<int?>("Variant");
b.HasKey("Id");
b.HasIndex("IntAction");
b.HasIndex("Variant");
b.ToTable("KeyBinding");
});
modelBuilder.Entity("osu.Game.IO.FileInfo", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Hash");
b.Property<int>("ReferenceCount");
b.HasKey("Id");
b.HasIndex("Hash")
.IsUnique();
b.HasIndex("ReferenceCount");
b.ToTable("FileInfo");
});
modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b =>
{
b.Property<int?>("Id")
.ValueGeneratedOnAdd();
b.Property<bool>("Available");
b.Property<string>("InstantiationInfo");
b.Property<string>("Name");
b.HasKey("Id");
b.HasIndex("Available");
b.HasIndex("InstantiationInfo")
.IsUnique();
b.HasIndex("Name")
.IsUnique();
b.ToTable("RulesetInfo");
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b =>
{
b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "Difficulty")
.WithMany()
.HasForeignKey("BeatmapDifficultyId")
.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()
.HasForeignKey("MetadataId");
b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset")
.WithMany()
.HasForeignKey("RulesetInfoId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b =>
{
b.HasOne("osu.Game.Beatmaps.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")
.WithMany("Files")
.HasForeignKey("BeatmapSetInfoId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("osu.Game.IO.FileInfo", "FileInfo")
.WithMany()
.HasForeignKey("FileInfoId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@ -105,7 +105,6 @@ namespace osu.Game
dependencies.Cache(LocalConfig);
using (var dbContext = createDbContext())
if (dbContext.Database.GetPendingMigrations().Any())
dbContext.Database.Migrate();
dependencies.Cache(API = new APIAccess

View File

@ -415,6 +415,11 @@
<Compile Include="IO\Serialization\IJsonSerializable.cs" />
<Compile Include="IPC\BeatmapIPCChannel.cs" />
<Compile Include="IPC\ScoreIPCChannel.cs" />
<Compile Include="Migrations\20171009205048_Init.cs" />
<Compile Include="Migrations\20171009205048_Init.designer.cs">
<DependentUpon>20171009205048_Init.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\OsuDbContextModelSnapshot.cs" />
<Compile Include="Online\API\APIAccess.cs" />
<Compile Include="Online\API\APIRequest.cs" />
<Compile Include="Online\API\IOnlineComponent.cs" />
@ -860,9 +865,7 @@
<ItemGroup>
<EmbeddedResource Include="lazer.ico" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.