create views after database cloning

This commit is contained in:
Daniel Seifert 2024-10-29 11:42:02 +01:00
parent 5b4a66a5f0
commit 8ff4b2f167

View File

@ -125,6 +125,9 @@ task('shop:cloneDatabase', function () {
info('cloning database'); info('cloning database');
$auth = "-h".$source_host." -P".$source_port." -u".$source_user." -p'".$source_pass."'"; $auth = "-h".$source_host." -P".$source_port." -u".$source_user." -p'".$source_pass."'";
run("{{bin/mysqldump}} ".$auth." --opt --no-create-db -f ".$source_name." $({{bin/mysql}} ".$auth." -ANe\"SET group_concat_max_len = 10485760; SELECT GROUP_CONCAT(table_name SEPARATOR ' ') FROM information_schema.tables WHERE table_schema='".$source_name."' AND engine IS NOT NULL;\") | {{bin/mysql}} --defaults-extra-file={{db_conf_path}} -f {{db_name}}"); run("{{bin/mysqldump}} ".$auth." --opt --no-create-db -f ".$source_name." $({{bin/mysql}} ".$auth." -ANe\"SET group_concat_max_len = 10485760; SELECT GROUP_CONCAT(table_name SEPARATOR ' ') FROM information_schema.tables WHERE table_schema='".$source_name."' AND engine IS NOT NULL;\") | {{bin/mysql}} --defaults-extra-file={{db_conf_path}} -f {{db_name}}");
info('creating views');
run('{{release_or_current_path}}/vendor/bin/oe-eshop-db_views_regenerate');
info('successfully finished');
} else { } else {
info('abborted'); info('abborted');
} }