mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 04:52:53 +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;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Realms;
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
{
|
{
|
||||||
public interface IHasGuidPrimaryKey
|
public interface IHasGuidPrimaryKey
|
||||||
{
|
{
|
||||||
|
[JsonIgnore]
|
||||||
|
[Ignored]
|
||||||
|
public Guid Guid
|
||||||
|
{
|
||||||
|
get => new Guid(ID);
|
||||||
|
set => ID = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[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)
|
public RealmWrapper(T original, IRealmFactory contextFactory)
|
||||||
{
|
{
|
||||||
ContextFactory = contextFactory;
|
ContextFactory = contextFactory;
|
||||||
ID = original.ID;
|
ID = original.Guid;
|
||||||
|
|
||||||
var originalContext = original.Realm;
|
var originalContext = original.Realm;
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using Realms;
|
using Realms;
|
||||||
@ -11,7 +10,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
[MapTo("KeyBinding")]
|
[MapTo("KeyBinding")]
|
||||||
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey
|
public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey
|
||||||
{
|
{
|
||||||
public Guid ID { get; set; }
|
public string ID { get; set; }
|
||||||
|
|
||||||
public int? RulesetID { get; set; }
|
public int? RulesetID { get; set; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user