Migrate to declarative schema
-
27-02-2021 - |
Question
people. I'm trying to migrate to declarative schema on my module with magento v2.3.1. But when i'm running php bin/magento setup:install --convert-old-scripts=1
it doesn't generates any db_schema.xml. What i'm doing wrong?
Solution
Try to remove your module from setup_module
table and rerun the command.
As far as I understand, Magento analyzes DDL commands called during setup:upgrade
to generate the schema.
In your case, I assume, the legacy install scripts are not being executed.
OTHER TIPS
In order to migrate your install and upgrade schema of already installed module to db_schema.xml follow below steps
- Remove your module entry from
setup_module
table - Drop all your module tables as mentioned in your install and upgrade schema
- Execute
php bin/magento setup:upgrade --convert-old-scripts=1
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange