Domanda

I'm following the guide from Magento DevDocs about the Declarative Schema

I created a new module with old setup way (InstallSchema.php, InstallData.php) to test the convert install/upgrade schema scripts to db_schema.xml config. I ran two commands:

bin/magento setup:install --convert-old-scripts=1
bin/magento setup:upgrade --convert-old-scripts=1

But, I didn't see the db_schema.xml in my custom module. Why the db_schema.xml didn't generate in my module?

I also see the note from Magento

The Schema Listener tool listens for schema changes and attempts to change Magento code, so it should not be run in production mode. It is disabled by default.

So, what should I do in my case? My app is in developer mode.

È stato utile?

Soluzione

After writing my question. I found my issue: I had run the setup upgrade command before.

So, I removed my module from setup_module table and my custom data table. Then I ran the two commands again.

bin/magento setup:install --convert-old-scripts=1
bin/magento setup:upgrade --convert-old-scripts=1
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top