Take the array key into account when checking whether a KEY is up to date in Database...
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 4 Aug 2021 08:36:12 +0000 (10:36 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 4 Aug 2021 08:36:12 +0000 (10:36 +0200)
commitd7f721d6f920d66f75102723b504d89e57a8c9ff
tree7d88e05a0d400ee2fe89eabb75adb20227189a03
parent7dddcffa642cdcc513afb6002ad401ab9acec120
Take the array key into account when checking whether a KEY is up to date in DatabaseTableChangeProcessor

Previously updating a (pretty contrived) KEY that looks like this:

    […] UNIQUE KEY someIndex (`UNIQUE`)

to:

    […] KEY someIndex (`UNIQUE`)

would not do anything.

Converted into the `getData()` representation of the PHP DDL API these would
look like:

    [ 'columns' => 'UNIQUE'
    , 'type' => 'UNIQUE'
    ]

and

    [ 'columns' => 'UNIQUE'
    , 'type' => null
    ]

respectively.

Now taking the diff of the first array against the second array (subtracting
the second from the first) will remove *both* 'UNIQUE' values, resulting in an
empty difference, thus believing both KEYs are identical.

Fix this issue by using `array_diff_assoc` which will also take the key into
account.
wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php