remove migration code
This commit is contained in:
@@ -56,8 +56,6 @@ internal class Configuration : IPluginConfiguration
|
||||
public bool OverrideStyle;
|
||||
public string? ChosenStyle;
|
||||
|
||||
public uint DatabaseMigration = LatestDbVersion;
|
||||
|
||||
internal void UpdateFrom(Configuration other)
|
||||
{
|
||||
HideChat = other.HideChat;
|
||||
@@ -96,7 +94,6 @@ internal class Configuration : IPluginConfiguration
|
||||
WindowAlpha = other.WindowAlpha;
|
||||
ChatColours = other.ChatColours.ToDictionary(entry => entry.Key, entry => entry.Value);
|
||||
Tabs = other.Tabs.Select(t => t.Clone()).ToList();
|
||||
DatabaseMigration = other.DatabaseMigration;
|
||||
OverrideStyle = other.OverrideStyle;
|
||||
ChosenStyle = other.ChosenStyle;
|
||||
}
|
||||
|
||||
+15
-35
@@ -45,41 +45,21 @@ internal class Store : IDisposable
|
||||
// EnumAsInteger = true,
|
||||
};
|
||||
|
||||
if (Plugin.Config.DatabaseMigration == 0)
|
||||
{
|
||||
BsonMapper.Global.Entity<Message>()
|
||||
.Id(msg => msg.Id)
|
||||
.Ctor(doc => new Message(
|
||||
doc["_id"].AsObjectId,
|
||||
(ulong) doc["Receiver"].AsInt64,
|
||||
(ulong) doc["ContentId"].AsInt64,
|
||||
DateTime.UnixEpoch.AddMilliseconds(doc["Date"].AsInt64),
|
||||
doc["Code"].AsDocument,
|
||||
doc["Sender"].AsArray,
|
||||
doc["Content"].AsArray,
|
||||
doc["SenderSource"],
|
||||
doc["ContentSource"],
|
||||
doc["SortCode"].AsDocument
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
BsonMapper.Global.Entity<Message>()
|
||||
.Id(msg => msg.Id)
|
||||
.Ctor(doc => new Message(
|
||||
doc["_id"].AsObjectId,
|
||||
(ulong) doc["Receiver"].AsInt64,
|
||||
(ulong) doc["ContentId"].AsInt64,
|
||||
DateTime.UnixEpoch.AddMilliseconds(doc["Date"].AsInt64),
|
||||
doc["Code"].AsDocument,
|
||||
doc["Sender"].AsArray,
|
||||
doc["Content"].AsArray,
|
||||
doc["SenderSource"],
|
||||
doc["ContentSource"],
|
||||
doc["SortCode"].AsDocument,
|
||||
doc["ExtraChatChannel"]
|
||||
));
|
||||
}
|
||||
BsonMapper.Global.Entity<Message>()
|
||||
.Id(msg => msg.Id)
|
||||
.Ctor(doc => new Message(
|
||||
doc["_id"].AsObjectId,
|
||||
(ulong) doc["Receiver"].AsInt64,
|
||||
(ulong) doc["ContentId"].AsInt64,
|
||||
DateTime.UnixEpoch.AddMilliseconds(doc["Date"].AsInt64),
|
||||
doc["Code"].AsDocument,
|
||||
doc["Sender"].AsArray,
|
||||
doc["Content"].AsArray,
|
||||
doc["SenderSource"],
|
||||
doc["ContentSource"],
|
||||
doc["SortCode"].AsDocument,
|
||||
doc["ExtraChatChannel"]
|
||||
));
|
||||
|
||||
BsonMapper.Global.RegisterType<Payload?>(
|
||||
payload =>
|
||||
|
||||
Reference in New Issue
Block a user