From e7ca4ee6a627bc75f2d159cc46b9d3f174c32456 Mon Sep 17 00:00:00 2001 From: Infi Date: Thu, 18 Apr 2024 12:11:55 +0200 Subject: [PATCH] remove migration code --- ChatTwo/Configuration.cs | 3 --- ChatTwo/Store.cs | 50 ++++++++++++---------------------------- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/ChatTwo/Configuration.cs b/ChatTwo/Configuration.cs index ca97732..85c4a06 100755 --- a/ChatTwo/Configuration.cs +++ b/ChatTwo/Configuration.cs @@ -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; } diff --git a/ChatTwo/Store.cs b/ChatTwo/Store.cs index 95212fb..63be71b 100755 --- a/ChatTwo/Store.cs +++ b/ChatTwo/Store.cs @@ -45,41 +45,21 @@ internal class Store : IDisposable // EnumAsInteger = true, }; - if (Plugin.Config.DatabaseMigration == 0) - { - BsonMapper.Global.Entity() - .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() - .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() + .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 =>