From c0cd59c4a250e1755c3bf8fd62760b8228964bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Wed, 12 Apr 2023 16:54:18 +0200 Subject: [PATCH] Fix database creation --- .ddev/commands/web/install-magento-ce | 2 +- .ddev/commands/web/install-magento-ce-git | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ddev/commands/web/install-magento-ce b/.ddev/commands/web/install-magento-ce index ed01feca..00ec8137 100755 --- a/.ddev/commands/web/install-magento-ce +++ b/.ddev/commands/web/install-magento-ce @@ -26,7 +26,7 @@ MAGENTO_SUBDOMAIN="${MAGENTO_VERSION//[-_.]/-}" USE_ELASTICSEARCH=$2 check_if_db_exists() { - echo "SHOW DATABASES" | mysql -hdb -udb -pdb | grep -q "$MAGENTO_DB_NAME" + echo "SHOW DATABASES" | mysql -hdb -udb -pdb | grep -qE "^$MAGENTO_DB_NAME\$" if [ $? -eq 1 ]; then echo "CREATE DATABASE ${MAGENTO_DB_NAME}" | mysql -hdb -uroot -proot diff --git a/.ddev/commands/web/install-magento-ce-git b/.ddev/commands/web/install-magento-ce-git index e8ab4b69..e649c737 100755 --- a/.ddev/commands/web/install-magento-ce-git +++ b/.ddev/commands/web/install-magento-ce-git @@ -26,7 +26,7 @@ MAGENTO_ROOT_DIR="/opt/magento-test-environments/magento_${NORMALIZED_GIT_BRANCH MAGENTO_SUBDOMAIN="${NORMALIZED_GIT_BRANCH//[-_.]/-}" check_if_db_exists() { - echo "SHOW DATABASES" | mysql -hdb -udb -pdb | grep -q "$MAGENTO_DB_NAME" + echo "SHOW DATABASES" | mysql -hdb -udb -pdb | grep -qE "^$MAGENTO_DB_NAME\$" if [ $? -eq 1 ]; then echo "CREATE DATABASE ${MAGENTO_DB_NAME}" | mysql -hdb -uroot -proot