mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +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:
parent
ae76eca564
commit
845d5cdea2
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user