remove migration code

This commit is contained in:
Infi
2024-04-18 12:11:55 +02:00
parent 79488fdaab
commit e7ca4ee6a6
2 changed files with 15 additions and 38 deletions
-3
View File
@@ -56,8 +56,6 @@ internal class Configuration : IPluginConfiguration
public bool OverrideStyle; public bool OverrideStyle;
public string? ChosenStyle; public string? ChosenStyle;
public uint DatabaseMigration = LatestDbVersion;
internal void UpdateFrom(Configuration other) internal void UpdateFrom(Configuration other)
{ {
HideChat = other.HideChat; HideChat = other.HideChat;
@@ -96,7 +94,6 @@ internal class Configuration : IPluginConfiguration
WindowAlpha = other.WindowAlpha; WindowAlpha = other.WindowAlpha;
ChatColours = other.ChatColours.ToDictionary(entry => entry.Key, entry => entry.Value); ChatColours = other.ChatColours.ToDictionary(entry => entry.Key, entry => entry.Value);
Tabs = other.Tabs.Select(t => t.Clone()).ToList(); Tabs = other.Tabs.Select(t => t.Clone()).ToList();
DatabaseMigration = other.DatabaseMigration;
OverrideStyle = other.OverrideStyle; OverrideStyle = other.OverrideStyle;
ChosenStyle = other.ChosenStyle; ChosenStyle = other.ChosenStyle;
} }
-20
View File
@@ -45,25 +45,6 @@ internal class Store : IDisposable
// EnumAsInteger = true, // 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>() BsonMapper.Global.Entity<Message>()
.Id(msg => msg.Id) .Id(msg => msg.Id)
.Ctor(doc => new Message( .Ctor(doc => new Message(
@@ -79,7 +60,6 @@ internal class Store : IDisposable
doc["SortCode"].AsDocument, doc["SortCode"].AsDocument,
doc["ExtraChatChannel"] doc["ExtraChatChannel"]
)); ));
}
BsonMapper.Global.RegisterType<Payload?>( BsonMapper.Global.RegisterType<Payload?>(
payload => payload =>