1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Switch guid to store as string until fody issues are resolved

See
https://github.com/realm/realm-dotnet/issues/740#issuecomment-755898968
This commit is contained in:
Dean Herbert 2021-01-07 15:41:58 +09:00
parent ae76eca564
commit 845d5cdea2
3 changed files with 12 additions and 4 deletions

View File

@ -4,13 +4,22 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using Realms;
namespace osu.Game.Database
{
public interface IHasGuidPrimaryKey
{
[JsonIgnore]
[Ignored]
public Guid Guid
{
get => new Guid(ID);
set => ID = value.ToString();
}
[JsonIgnore]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
Guid ID { get; set; }
string ID { get; set; }
}
}

View File

@ -197,7 +197,7 @@ namespace osu.Game.Database
public RealmWrapper(T original, IRealmFactory contextFactory)
{
ContextFactory = contextFactory;
ID = original.ID;
ID = original.Guid;
var originalContext = original.Realm;

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Input.Bindings;
using osu.Game.Database;
using Realms;
@ -11,7 +10,7 @@ namespace osu.Game.Input.Bindings
[MapTo("KeyBinding")]
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey
{
public Guid ID { get; set; }
public string ID { get; set; }
public int? RulesetID { get; set; }