Allow a single beatmap to reference the same file multiple times

This fixes incorrect reference counts causing database desync.
This commit is contained in:
Dean Herbert
2017-07-31 21:48:03 +09:00
parent bc21798e41
commit 404497fa10
6 changed files with 46 additions and 28 deletions

View File

@ -2,16 +2,26 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.IO;
using SQLite.Net.Attributes;
using SQLiteNetExtensions.Attributes;
namespace osu.Game.Beatmaps
{
public class BeatmapSetFileInfo
{
[ForeignKey(typeof(BeatmapSetInfo))]
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[ForeignKey(typeof(BeatmapSetInfo)), NotNull]
public int BeatmapSetInfoID { get; set; }
[ForeignKey(typeof(FileInfo))]
[ForeignKey(typeof(FileInfo)), NotNull]
public int FileInfoID { get; set; }
[OneToOne(CascadeOperations = CascadeOperation.CascadeRead)]
public FileInfo FileInfo { get; set; }
[NotNull]
public string Filename { get; set; }
}
}