fix: add missing backticks in Blade for MySQL/MariaDB database names with hyphens (#523)

* fix: add missing backticks in Blade for MySQL/MariaDB database names with hyphens

Before:
The CREATE DATABASE command failed for database names containing hyphens (-) because MySQL/MariaDB requires backticks around such names, but they were missing in the Blade template.

After:
Backticks (```) are now correctly added in the Blade template, ensuring MySQL properly interprets database names with hyphens.

Why:
MySQL/MariaDB does not allow hyphens in database names unless they are enclosed in backticks. The Blade template was missing these backticks, causing syntax errors. Adding them ensures the command executes successfully. 🚀

* fix: added hyphens to other places as well

---------

Co-authored-by: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com>
This commit is contained in:
Dimitar Yanakiev
2025-04-05 22:58:25 +03:00
committed by GitHub
parent 4e5f975917
commit 564b97e2aa
10 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
if ! sudo mariadb -e "CREATE DATABASE IF NOT EXISTS {{ $name }} CHARACTER SET '{{ $charset }}' COLLATE '{{ $collation }}'"; then
if ! sudo mariadb -e "CREATE DATABASE IF NOT EXISTS \`{{ $name }}\` CHARACTER SET '{{ $charset }}' COLLATE '{{ $collation }}'"; then
echo 'VITO_SSH_ERROR' && exit 1
fi