Closed mgdelacroix closed 1 month ago
@lieut-data we could do one big "init" migration only, but there are two downsides that I can think of:
morph
, run the plugin and then update to the first version including it, for example), but that's added complexity./update-branch
Summary
This PR integrates
morph
into the plugin store code, moving all migrations to SQL files, splitting them for improved clarity and structure. It creates a newmsteamssync_system_settings
table that stores one row per data migration, allowing them to indicate when they've run and removing the need for checking the database status every time the plugin starts to see if each data migration should run.The
Migrate
method implements a sequence of migrations that ensures that at every step all the requirements of the next migration are met or checked (either by morph or the data migration through the previously mentioned table), and every step logs when the migration starts, stops and the elapsed time.