From ed7a4977a2fe1e2d7c34a1a24874d0c2283871e1 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Mon, 3 Feb 2025 11:37:55 +0100 Subject: [PATCH] WIP: Patch --- patches/patch20250130-8.0.1/patch.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/patches/patch20250130-8.0.1/patch.sh b/patches/patch20250130-8.0.1/patch.sh index bad63f1..863d112 100755 --- a/patches/patch20250130-8.0.1/patch.sh +++ b/patches/patch20250130-8.0.1/patch.sh @@ -36,11 +36,22 @@ check_version $OLD_VERSION # Update charsets and collations. +# Remove some constraints first. +mysql_execute 'ALTER TABLE user_info DROP FOREIGN KEY `subjects_ibfk_2`;' + # Get all tables, drop first line, take first column tables=$(mysql_execute "SHOW TABLE status where Collation='utf8mb3_unicode_ci';" -B | tail +2 | awk '{print $1}') for table in $tables; do mysql_execute "ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE uca1400_as_ci;" done + +# Add constraints again. +mysql_execute 'ALTER TABLE user_info MODIFY COLUMN `entity` VARCHAR(255) COLLATE utf8mb4_bin DEFAULT NULL;' +mysql_execute 'ALTER TABLE user_info ADD CONSTRAINT `subjects_ibfk_2` FOREIGN KEY (`entity`) REFERENCES `entity_ids` (`id`);' + + + + # mysql_execute "UPDATE data_type SET datatype=17 WHERE datatype=3" -- GitLab