diff --git a/module/migrations.js b/module/migrations.js index 6ea83ac3..6bde358b 100644 --- a/module/migrations.js +++ b/module/migrations.js @@ -614,7 +614,7 @@ class _12_0_37_MigrationAlchimieEtat extends Migration { return ['Alchimie', 'Repos', 'Soin', 'Autre'].includes(categorie) ? 'Liquide' : 'Autre' } - async migratePotion(potion) { + migratePotion(potion) { const newCategorie = this.mappingCategorie(potion.system.categorie) return { _id: potion.id, @@ -625,6 +625,19 @@ class _12_0_37_MigrationAlchimieEtat extends Migration { } } +class _12_0_38_TachesEcriture extends Migration { + get code() { return "migration-tache-ecriture" } + get version() { return "12.0.38" } + + async migrate() { + await this.applyItemsUpdates(items => items + .filter(it => [ITEM_TYPES.tache, ITEM_TYPES.livre, ITEM_TYPES.oeuvre, ITEM_TYPES.meditation].includes(it.type) ) + .filter(it => it.system.competence == 'Ecriture') + .map(it => { return { _id: it.id, 'system.competence': 'Écriture' } }) + ) + } +} + export class Migrations { static getMigrations() { return [ @@ -647,6 +660,7 @@ export class Migrations { new _12_0_26_MigrationVoieSorts(), new _12_0_32_MigrationRaces(), new _12_0_37_MigrationAlchimieEtat(), + new _12_0_38_TachesEcriture() ]; }