Open
Description
Description
Indexes are treated as destructive operation (element*removal) in https://github.com/magento/magento2/blob/2.3-develop/lib/internal/Magento/Framework/Setup/Declaration/Schema/Diff/Diff.php#L165. As result indexes cannot be removed unless declared in db_schema*whitelist.json
. In fact, index removal is not destructive as it does not delete any data or impact any behavior. Only performance may be affected.
STR
- Declare index on any table (existing index may be used)
- Install Magento
- Run
**show create table <table_name>;**
to verify that index is present - Remove index declaration from
db_schema.xml
- Run
bin/magento setup:upgrade
- Run
**show create table <table_name>;**
to verify that index is still present - Add removed index to
db*schema*whitelist.json
- Run
bin/magento setup:upgrade
- Run
**show create table <table_name>;**
to verify that index is removed
AR
- Index created by declaration is not removed from DB unless declared in a whitelist
ER
- Index created by declaration is removed when a declaration removed
Metadata
Metadata
Assignees
Labels
Issue recommended for the contribution dayGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 4. Acknowledged. Issue is added to backlog and ready for developmentA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchAffects non-critical data or functionality and does not force users to employ a workaround.
Type
Projects
Status
Pull Request In Progress