To-do list | Part-11 Working with declarative schema | Projects in Magento 2

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 2

  • @AnkushUkey-k6l
    @AnkushUkey-k6l 11 місяців тому +1

    what is the use of db_schema_whitelist.json file?

    • @knowthemage
      @knowthemage  11 місяців тому

      The use of the db_schema_whitelist.json file in Magento 2 is considered a temporary solution to encourage developers, to define their database structures in declarative schema XML files. This file is used to specify which database tables are allowed and disallowed during the setup and upgrade processes.
      *New Table*: When creating a new table, remember to generate the db_schema_whitelist.json file.
      *Drop Table*: When dropping a table, do not remove it from the db_schema_whitelist.json file, otherwise it will not be dropped.
      *Rename Table*: When renaming a table, remember to regenerate the db_schema_whitelist.json file so it contains the new name in addition to the old one.
      *New Column*: When adding a new column into table, remember to generate the db_schema_whitelist.json file.
      *Drop a Column*: It is possible to drop a column only if it exists in the db_schema_whitelist.json file.
      *Drop a foreign key*: It is possible to drop a foreign key only if it exists in the db_schema_whitelist.json file.
      See more in documentation: developer.adobe.com/commerce/php/development/components/declarative-schema/migration-scripts/