How To Create db_schema_whitelist.json in Magento 2.3.x & 2.4.x

db_schema_whitelist.json file having history of all tables, columns, primary keys, foreign key, constraint keys combination etc, those are created by using the declarative schema.

There are two ways to generate db_schema_whitelist.json by following below methods

Step [1] – Manually To Create db_schema_whitelist.json

Need to create file below path

app/code/VendorName/ModuleName/etc/db_schema_whitelist.json

Step [2] – CLI Command To Create db_schema_whitelist.json

php bin/magento setup:db-declaration:generate-whitelist --module-name=VendorName_ModuleName

It will auto create db_schema_whitelist.json below path

   app/code/VendorName/ModuleName/etc/db_schema_whitelist.json 

Leave a Reply

Your email address will not be published. Required fields are marked *