Skip to content

Commit

Permalink
Migration Info
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkRRb committed Feb 4, 2025
1 parent 7392b34 commit 10c0d7b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Lagrange.OneBot.Core.Network.Service;
using Lagrange.OneBot.Core.Notify;
using Lagrange.OneBot.Core.Operation;
using Lagrange.OneBot.Database;
using Lagrange.OneBot.Message;
using Lagrange.OneBot.Utility;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -86,7 +87,13 @@ public static HostApplicationBuilder ConfigureOneBot(this HostApplicationBuilder
if (!Directory.Exists(prefix)) Directory.CreateDirectory(prefix);
string path = Path.GetFullPath(Path.Join(prefix, ".realm"));

return new RealmConfiguration(path);
return new RealmConfiguration(path)
{
// Increase one version above upstream to ensure migration
// When adding or subtracting MessageRecord fields, you need to increase 1
// In addition to this case, you need to write `MigrationCallback`
SchemaVersion = 2,
};
})
.AddSingleton<RealmHelper>()

Expand Down

0 comments on commit 10c0d7b

Please sign in to comment.