separate migrations from CREATE / DROP plugin
-
migration usage shall support a list of already applied migrations. I suggest to store a list of file that were applied during previous migrations of the same plugin with any version. We always run migrations for some specific version of the plugin, because we have to lookup in the folder of the specific version. If we try to apply migration we shall calculate which migrations were not applied (basically we just diff lists of applied files and all migrations of the specified version) and apply those (ordering those as usual). -
add boolean parameter migrate(default - false) toinstall_plugin. That parameter controls ifUPmigrations should be run. -
add boolean parameter drop_data(default - false) todrop_plugin. That parameter controls ifDOWNmigrations should be run -
create new command to run UP migrations. Accepts versionas required parameter. We have to run only new migrations. Command shall consider plugin version to figure out migration folder. -
create new command to run DOWN migrations. Accepts versionas required parameter. We do not intend to support migration rollback for specific version so we execute alldownmigrations. Command shall consider plugin version to figure out migration folder.
Edited by Дмитрий Кольцов