Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back up SQL from cleanup_mri_tables_for_19-0_release.php saved in project/backup now #3483

Merged
merged 2 commits into from
Feb 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tools/cleanup_mri_tables_for_19-0_release.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ function backupEntries($selectID, $table_name, $FK_field)
$IDs = generateIdList($selectID, $FK_field);
$where = $FK_field . " IN (" . $IDs . ")";

// create directory where the back up will go if it does not exist yet
if ( !file_exists(__DIR__."/../project/backup") ) {
mkdir(__DIR__."/../project/backup");
}

// grep database connection information from NDB_Config for mysqldump
$config = NDB_Config::singleton();
$config->load(__DIR__."/../project/config.xml");
Expand All @@ -287,7 +292,7 @@ function backupEntries($selectID, $table_name, $FK_field)
escapeshellarg($table_name) . " " .
"--where=" . escapeshellarg($where) . " " .
"--compact --no-create-info" . " " .
">> ./backup_release_19-0_upgrade.sql";
">> " . __DIR__ . "/../project/backup/backup_release_19-0_upgrade.sql";

system($sqldump, $retval); // execute mysqldump

Expand Down