Created
October 16, 2019 23:55
-
-
Save jonpugh/6455d67d065c369a1f441a77b7ba180d to your computer and use it in GitHub Desktop.
Manual workaround for database dumps "DEFINER" issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Because of these issues: | |
# - https://stackoverflow.com/a/44015870/292408 | |
# - https://www.drupal.org/project/workflow_participants/issues/3073354 | |
# A second time because the export has the issue too. | |
- name: Add this function to /var/aegir/.drush/va.drush.inc | |
function drush_va_post_sql_dump() { | |
// BACKEND_RESULT is the full path to the file. | |
$file_ext_gz = drush_get_context('BACKEND_RESULT'); | |
shell_exec("gunzip $file_ext_gz"); | |
$file_ext_sql = str_replace('.gz', '', $file_ext_gz); | |
$CMD = <<<CMD | |
sed 's/\sDEFINER="[^`]*"@"[^`]*"//g' -i $file_ext_sql | |
CMD; | |
shell_exec($CMD); | |
shell_exec("gzip $file_ext_sql"); | |
drush_log('SQL Dump was ungzipped, DEFINER string stripped and gzipped again.', 'notice'); | |
} | |
Yeah, the Drupal Workflow Participants module somehow introduced this issue (couldn't find it in source code search), I posted here about it https://www.drupal.org/project/workflow_participants/issues/3073354.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something todo with RDS? 🗡️
cc @ElijahLynn