diff --git a/module/systemRegistration/migration-handlers/2_5_2.mjs b/module/systemRegistration/migration-handlers/2_5_2.mjs index ec892d83..f6d9ea77 100644 --- a/module/systemRegistration/migration-handlers/2_5_2.mjs +++ b/module/systemRegistration/migration-handlers/2_5_2.mjs @@ -2,14 +2,9 @@ import { MigrationHandlerBase } from './base.mjs'; export class Migration_2_5_2 extends MigrationHandlerBase { version = '2.5.2'; - documentNames = ['Actor', 'Item']; - /** @protected */ - _preMigrate() { - - } - - async updateEffectSource(effectSource, item) { + /** @inheritdoc */ + async updateActiveEffectSource(effectSource, item) { let shouldUpdate = false; const newChanges = []; const srdItem = item?._stats.compendiumSource ? diff --git a/module/systemRegistration/migration-handlers/base.mjs b/module/systemRegistration/migration-handlers/base.mjs index 1ae90d20..88582810 100644 --- a/module/systemRegistration/migration-handlers/base.mjs +++ b/module/systemRegistration/migration-handlers/base.mjs @@ -1,3 +1,7 @@ +/** + * @import DHItem from "../../documents/item.mjs"; + */ + /** * The base class of an async migration. * These are generally run between versions for things that require compendiums or must be done in post. @@ -7,6 +11,17 @@ export class MigrationHandlerBase { version = null; + /** + * Gets change data for an active effect's source, or null if no changes + * @param {object} effectSource + * @param {DHItem} item + * @returns {Promise} + * @protected + */ + async updateActiveEffectSource(effectSource, item) { + return null; + } + async migrate() { // todo: handle migrations, but have a way for a migration handler to specify if migrations are handled // todo: handle more than just migrating effects. Right now this can only migrate effects @@ -33,7 +48,7 @@ export class MigrationHandlerBase { const updateItem = async item => { const itemUpdates = []; for (const effect of item.effects) { - const changes = await this.updateEffectSource(effect.toObject(), effect.parent); + const changes = await this.updateActiveEffectSource(effect.toObject(), item); if (changes) itemUpdates.push(changes); } if (itemUpdates.length) {