Skip to content

Commit

Permalink
NEXT-15186 - use strtolower to match the key names
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPietrzyk committed May 6, 2021
1 parent 6245c59 commit 9ad6334
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions changelog/_unreleased/2020-05-06-fix-cms-versionable-migration.md
@@ -0,0 +1,10 @@
---
title: Fix CMS versionable migration
issue: NEXT-15186
flag:
author: JKan Pietrzyk
author_email:
author_github:
---
# Core
* Fix a Bug where database keys written in upper case cause the migration to fail
Expand Up @@ -72,7 +72,7 @@ private function createDropKeysPlaybookEntries(array $keyStructures): array

$playbook[] = sprintf(self::DROP_FOREIGN_KEY, $keyStructure['TABLE_NAME'], $constraintName);

if (\array_key_exists($constraintName, $indexes)) {
if (\array_key_exists(strtolower($constraintName), $indexes)) {
$playbook[] = sprintf(self::DROP_KEY, $keyStructure['TABLE_NAME'], $constraintName);
}
}
Expand Down
Expand Up @@ -41,8 +41,8 @@ CREATE TABLE `_dpkc_1n_relation1`
`varchar` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`_dpkc_main_id` binary(16) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk._dpkc_1n_relation1._dpkc_main_id` (`_dpkc_main_id`),
CONSTRAINT `fk._dpkc_1n_relation1._dpkc_main_id` FOREIGN KEY (`_dpkc_main_id`) REFERENCES `_dpkc_main` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
KEY `FK._dpkc_1n_relation1._dpkc_main_id` (`_dpkc_main_id`),
CONSTRAINT `FK._dpkc_1n_relation1._dpkc_main_id` FOREIGN KEY (`_dpkc_main_id`) REFERENCES `_dpkc_main` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE `_dpkc_1n_relation2`
Expand Down

0 comments on commit 9ad6334

Please sign in to comment.