kellerkinderDE / shopware6-database-dump

Dump a Shopware 6 database for your local environments (and filter GDPR data)
MIT License
38 stars 11 forks source link

[noticket] Check if mysqldump has --column-statistics to allow for MariaDB/earlier MySQL compatibility. #3

Closed kleinmann closed 2 years ago

kleinmann commented 2 years ago

See #1.

aragon999 commented 2 years ago

This also needs to be changed when exporting the data, i.e.

diff --git a/shopware6-database-dump.sh b/shopware6-database-dump.sh
index 5ab9fdf..a4802c0 100755
--- a/shopware6-database-dump.sh
+++ b/shopware6-database-dump.sh
@@ -236,7 +236,7 @@ _dump() {

   printf ">> Creating data dump...\\n"

-  mysqldump --column-statistics=0 --no-create-info --skip-triggers --quick -C --hex-blob --single-transaction --host=${_HOST} --port=${_PORT} --user=${_USER} -p "${_IGNORED_TABLES_ARGUMENTS[@]}" ${_DATABASE} \
+  mysqldump $_COLUMN_STATISTICS --no-create-info --skip-triggers --quick -C --hex-blob --single-transaction --host=${_HOST} --port=${_PORT} --user=${_USER} -p "${_IGNORED_TABLES_ARGUMENTS[@]}" ${_DATABASE} \
     | LANG=C LC_CTYPE=C LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' \
     >> ${_FILENAME}