diff --git a/scripts/upgrade-utilities/playbooks/db-collation-alter.yml b/scripts/upgrade-utilities/playbooks/db-collation-alter.yml index ee16e7965a..3e7bb8a2bc 100644 --- a/scripts/upgrade-utilities/playbooks/db-collation-alter.yml +++ b/scripts/upgrade-utilities/playbooks/db-collation-alter.yml @@ -26,22 +26,22 @@ WHERE CCSA.collation_name = T.table_collation AND CCSA.CHARACTER_SET_NAME = 'utf8' AND CCSA.COLLATION_NAME = 'utf8_unicode_ci';" register: utf8_unicode_ci_tables - - name: Disable foreign key checks + - name: Disable global foreign key checks command: > mysql -e - "SET foreign_key_checks = 0;" + "SET GLOBAL FOREIGN_KEY_CHECKS = 0;" when: utf8_unicode_ci_tables.stdout_lines | length > 0 - name: Convert tables to utf8_general_ci collation command: > - mysql -e + mysql -e "ALTER TABLE {{ item.split()[1] }} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;" {{ item.split()[0] }} with_items: "{{ utf8_unicode_ci_tables.stdout_lines }}" when: item | search("^(?!table_schema)\w+\t\w+$") - - name: Enable foreign key checks + - name: Enable global foreign key checks command: > mysql -e - "SET foreign_key_checks = 1;" + "SET GLOBAL FOREIGN_KEY_CHECKS = 1;" when: utf8_unicode_ci_tables.stdout_lines | length > 0 - name: Find databases with utf8_unicode_ci collation command: >