Skip to content
Snippets Groups Projects
Verified Commit ed7a4977 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

WIP: Patch

parent f7a81cf4
No related branches found
No related tags found
1 merge request!33Fix accent sensitivity
Pipeline #60538 failed
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment