How to create dbschema.xml from installschema.php
2 Answers
Steps Taken To Generate the db_schema.xml file Automatically for any extension Example : VendorName_ModuleName -> Delete the Module entry from setup_module table -> Delete all the Related tables Used in your Extension -> After that Run the command on magento root
- bin/magento setup:install --convert-old-scripts=1
- bin/magento setup:upgrade --convert-old-scripts=1
The Above command will Generate the db_schema.xml file Under VendorName/ModuleName/etc/Directory
Reference Links : https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/migration-commands.html
To Generate the db_schema.xml file Automatically for any extension Example : VendorName_ModuleName
-> Delete the Module entry from setup_module table
-> Delete all the Related tables Used in your Extension
-> After that Run the command on magento root
- bin/magento setup:install --convert-old-scripts=1
- bin/magento setup:upgrade --convert-old-scripts=1
The Above command will Generate the db_schema.xml file Under VendorName/ModuleName/etc/ Directory.
Thanks.