The reproducer and fix is effectively identical to the one in
d7f721d6f920d66f75102723b504d89e57a8c9ff.
Package A: Installs KEY someIndex (`UNIQUE`)
Package B: Installs UNIQUE KEY someIndex2 (`UNIQUE`)
Package B: Drops UNIQUE KEY someIndex2 (`UNIQUE`)
It was erroneously detected that Package B would drop the index owned by
Package A. The actual dropping logic was already correct, just the safety check
was incorrect.
foreach ($table->getIndices() as $index) {
foreach ($existingIndices as $existingIndex) {
- if (empty(\array_diff($index->getData(), $existingIndex->getData()))) {
+ if (empty(\array_diff_assoc($index->getData(), $existingIndex->getData()))) {
if ($index->willBeDropped()) {
if ($this->getIndexPackageID($table, $index) !== $this->package->packageID) {
$errors[] = [