Simplify BeatmapSetInfo deletion by relying on cascading deletes

This commit is contained in:
Dean Herbert 2017-07-27 12:51:49 +09:00
parent c7a6343985
commit a90eff69db

View File

@ -98,19 +98,9 @@ namespace osu.Game.Beatmaps
{
try
{
foreach (var i in b.Beatmaps)
{
if (i.Metadata != null) Connection.Delete(i.Metadata);
if (i.Difficulty != null) Connection.Delete(i.Difficulty);
Connection.Delete(i);
}
if (b.Metadata != null) Connection.Delete(b.Metadata);
// many-to-many join table entries are not automatically tidied.
Connection.Table<BeatmapSetFileInfo>().Delete(f => f.BeatmapSetInfoID == b.ID);
Connection.Delete(b);
Connection.Delete(b, true);
}
catch (Exception e)
{