Skip to content

Indexes are not removed unless added to whitelist #30304

Open
@magento-engcom-team

Description

@magento-engcom-team

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

  1. Declare index on any table (existing index may be used)
  2. Install Magento
  3. Run **show create table <table_name>;** to verify that index is present
  4. Remove index declaration from db_schema.xml
  5. Run bin/magento setup:upgrade
  6. Run **show create table <table_name>;** to verify that index is still present
  7. Add removed index to db*schema*whitelist.json
  8. Run bin/magento setup:upgrade
  9. Run **show create table <table_name>;** to verify that index is removed

AR

  1. Index created by declaration is not removed from DB unless declared in a whitelist

ER

  1. Index created by declaration is removed when a declaration removed

Metadata

Metadata

Assignees

Labels

CDIssue recommended for the contribution dayComponent: OtherIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.3.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Pull Request In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions