[Fix] ActiveEffect Mode OneTime Migration (#2078)

* Migrations for ActiveEffect Mode
* Start on migration handlers

---------

Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
WBHarry 2026-07-12 00:37:02 +02:00 committed by GitHub
parent c6411ef0fe
commit 76ee777985
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 129 additions and 1 deletions

View file

@ -1,4 +1,5 @@
import { defaultRestOptions } from '../config/generalConfig.mjs';
import { Migration_2_5_2 } from './migration-handlers/2_5_2.mjs';
export async function runMigrations() {
let lastMigrationVersion = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion);
@ -320,7 +321,19 @@ export async function runMigrations() {
lastMigrationVersion = '2.1.0';
}
//#endregion
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
/* -------------------------------------------- */
/* New Style migrations below this point */
/* -------------------------------------------- */
const migrations = [
new Migration_2_5_2()
].filter(m => m.version && foundry.utils.isNewerVersion(m.version, lastMigrationVersion));
for (const handler of migrations) {
await handler.migrate();
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, handler.version);
}
}