[feat:] enable/disable label export (to only export running sheets

This commit is contained in:
2026-10-21 15:14:03 +02:00
parent ce46b90890
commit f09ccc883d
5 changed files with 29 additions and 3 deletions
+12 -1
View File
@@ -13,7 +13,7 @@ namespace Logof_Client;
public static class SchemaMigration
{
// Current schema version - increment when you make breaking changes
public const int CURRENT_SCHEMA_VERSION = 4;
public const int CURRENT_SCHEMA_VERSION = 5;
// Dictionary of migration functions, keyed by the version they migrate TO
private static readonly Dictionary<int, Func<JObject, JObject>> Migrations = new()
@@ -24,6 +24,7 @@ public static class SchemaMigration
// Example: Migration from v2 to v3
{ 4, MigrateV3ToV4 },
{ 5, MigrateV4ToV5 },
};
/// <summary>
@@ -104,6 +105,16 @@ public static class SchemaMigration
return obj;
}
private static JObject MigrateV4ToV5(JObject obj)
{
// Example: Add a new field that didn't exist before
if (!obj.ContainsKey("expLabEnable"))
{
obj["expLabEnable"] = JToken.FromObject(new PdfExportSettings().expLabEnable);
}
return obj;
}
/// <summary>
/// Registers a new migration function that will be called when upgrading to a specific version.