Domanda

I've run the command php bin/magento setup:db-declaration:generate-whitelist --module-name={Vendor_Module}

and receive the following error...

Magento was installed with a table prefix. Please re-install without prefix.

My table names do have a prefix name. What is the best way I can add this prefix for my commands?

I have 2 installations of Magento on the server.

Magento version 2.3.5

È stato utile?

Soluzione

According to Magento docs,

Whitelists cannot be generated on Magento instances that use a database prefix. The presence of a prefix impacts the names of some DB entities, such as the names of keys, and these names cannot be used in generated whitelists. The whitelist should be generated by the extension developer on a development environment with no prefixes.

The db_schema_whitelist.json file is a temporary solution while Magento team is migrating from old setup scripts to the declarative schema. It will be removed in the future, when upgrade scripts are no longer supported. It is used just to keep a track of the database updates.

Refer below link

https://devdocs.magento.com/guides/v2.4/extension-dev-guide/declarative-schema/migration-commands.html#create-whitelist

Altri suggerimenti

This is expected behavior. The whitelist should be generated on dev environment by the extension developer, so it should not be necessary to support DB with prefix.

Presence of the prefix impacts names of DB entities (such as names of keys), and such names can't be used in the generated whitelist.

The whitelist is a temporary solution while we're migrating from old setup scripts to the declarative schema, and in the future will be eliminated (together with the whitelist command).

Please refer this link

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top