OXID Community Console is a php console application for OXID Shop. It provides an API for writing various commands. We have shipped very common for every oxid shop project commands out of the box.
It would be nice to be able to execute migrations from modules directories aswell. Most modules use currently the onActivate() but implement their own logic which reads a SQL file in most cases.
I'm not sure if this is only needed for running migrations or for generating them, too. That would be a bit more hassle since we need to extend the template to include a specific namespace, put the migration file into a different directory + check if the directory exists etc.
In the first step it would be enough to just load them from the modules directory. You can always generate them and just copy the files to your module dir.
It would be nice to be able to execute migrations from modules directories aswell. Most modules use currently the
onActivate()
but implement their own logic which reads a SQL file in most cases.We could overwrite https://github.com/OXIDprojects/oxid-console/blob/83050a0e215b1949c3c1dc081aa734f7dcc60b8a/src/Core/Migration/MigrationHandler.php#L218 to load the migrations not only from the
migration
directory but from allmigration
directories in themodules
directory.I'm not sure if this is only needed for running migrations or for generating them, too. That would be a bit more hassle since we need to extend the template to include a specific namespace, put the migration file into a different directory + check if the directory exists etc.