From c5ab4a73a603d09f21d7c65867b52b5bb0b29290 Mon Sep 17 00:00:00 2001 From: Serraniel Date: Sat, 16 Feb 2019 20:58:56 +0100 Subject: [PATCH] #27 Fixed an error in migration to correct number format for LiteDB --- src/Discord Media Loader.Application/Core/Migrator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Discord Media Loader.Application/Core/Migrator.cs b/src/Discord Media Loader.Application/Core/Migrator.cs index 1492aa3..e543373 100644 --- a/src/Discord Media Loader.Application/Core/Migrator.cs +++ b/src/Discord Media Loader.Application/Core/Migrator.cs @@ -14,6 +14,9 @@ #endregion +using System; +using System.Collections.Generic; +using DML.AppCore.Classes; using LiteDB; namespace DML.Application.Core @@ -51,8 +54,8 @@ namespace DML.Application.Core pseudoId = timestamp - 1420070400000 << 22; pseudoId = pseudoId - (1000UL * 60 * 60 * 24 << 22); // substract one random day of pseudo id just in case the timestamp has errors } - - jobDoc["LastMessageId"] = pseudoId; + + jobDoc["LastMessageId"] = Convert.ToInt64(pseudoId); // LiteDB maps (u)long to Int64 jobDoc.Remove("KnownTimestamp"); Core.Database.Engine.Update("jobs", jobDoc);