Skip to content

Commit

Permalink
Fix database creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuench committed Jun 20, 2023
1 parent 905b6ff commit c0cd59c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ddev/commands/web/install-magento-ce
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .ddev/commands/web/install-magento-ce-git
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0cd59c

Please sign in to comment.