Magento 2 db_schema_whitelist.json file not creating

If you don’t know how to create db_schema_whitelist.json file then please check our previous blog post of how to create db_schema_whitelist.json file using CLI in Magento 2

  • Module is Disabled: The most command mistake I have ever seen with the developer is, that they are trying to create the db_schema_whitelist.json file for the disabled module. Please make sure your module is enabled before creating the db_schema_whitelist.json.
  • Wrong db_schema.xml: If the module is enabled, then make sure you have created the db_schema.xml file properly.
  • Wrong CLI Command: If file db_schema.xml is created properly then please double check the CLI command you run to create the db_schema_whitelist.json
    Following is the correct format to create the schema whitelist JSON file.
    php bin/magento setup:db-declaration:generate-whitelist –module-name=<Your_Module_Name>-