question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unnecessary System Data Migration if world has no settings (should use `systemVersion` from manifest)

See original GitHub issue

Originally in GitLab by @arcanistzed

I’m working on a world package for distribution and I am not including the settings.db with my package. I have noticed that there is always a migration whenever I install it despite it not needing one:

const NEEDS_MIGRATION_VERSION = "1.5.6";
const currentVersion = "";
isNewerVersion(NEEDS_MIGRATION_VERSION, currentVersion) // returns true

A solution for this would be to provide a fallback for the current version from game.world.data.systemVersion so that it isn’t an empty string.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arbroncommented, Jun 14, 2022

That is probably a good solution, but I think we’d want to reverse it and check the settings value first, and then the data value. That way once migrations have been applied they will update the saved settings value to ensure they aren’t applied a second time.

0reactions
arcanistzedcommented, Jun 14, 2022

I think an easy and simple solution to this is that it would read the world flags if present and then fallback to the current behavior:

- const currentVersion = game.settings.get("dnd5e", "systemMigrationVersion");
+ const currentVersion = game.world.data.flags.dnd5e?.version ?? game.settings.get("dnd5e", "systemMigrationVersion");

https://github.com/foundryvtt/dnd5e/blob/b81f78f954e9d793b7bd37ea66bb2cd42d5198da/dnd5e.js#L213

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Data Migration: Strategy and Best Practices
Data migration is the process of moving data from one system to another. See why it's important, and get best practices and key...
Read more >
Why Less Is More In Data Migration - Oliver Wyman
When companies migrate data, they generally aim to move all of the foundational data structures in their legacy systems to the new IT...
Read more >
Device compatibility overview - Android Developers
The API level allows you to declare the minimum version with which your app is compatible, using the <uses-sdk> manifest tag and its...
Read more >
Chrome Extensions: Migrating to Manifest V3
This guide provides you with the information needed to migrate an extension from Manifest V2 to Manifest V3. Some extensions require very ...
Read more >
Optimize data migration for finance and operations apps
Begin the optimization phase by using a subset of the data. For example, if you must import one million records, consider starting with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found