Skip to content
Snippets Groups Projects
Commit 988bc357 authored by jurgenhaas's avatar jurgenhaas
Browse files

Prepare DB collation before dumping data

parent 746b0807
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,12 @@
collectFilename: '{{ drushAlias }}.sql'
when: collectTask == 'db'
- name: Prepare DB collation
shell: drush -y {{ drushAlias }} eval "print(\Drupal::database()->getConnectionOptions()['database'])" | xargs -I % mysql --defaults-file=~/.my.cnf --execute 'select concat("alter table ",TABLE_SCHEMA,".",TABLE_NAME," CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;") from information_schema.TABLES where TABLE_SCHEMA="%" and TABLE_COLLATION="utf8mb4_0900_ai_ci"' | grep ^alter | mysql --defaults-file=~/.my.cnf
args:
chdir: '{{ webRoot }}'
when: collectTask == 'db' and drush_status is defined and ('Successful' in drush_status.stdout|default('') or 'Erfolgreich' in drush_status.stdout|default(''))
- name: Dump DB
shell: drush -y {{ drushAlias }} sql-dump --result-file={{ collectPath }}/{{ collectFilename }}
args:
......
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