mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
CI: Trying to get custom sql setup into the mysql testdb
This commit is contained in:
parent
8f908ed2ac
commit
0f0088cd9b
3 changed files with 14 additions and 4 deletions
12
.github/actions/setup-database/action.yml
vendored
12
.github/actions/setup-database/action.yml
vendored
|
|
@ -51,6 +51,12 @@ runs:
|
|||
SET GLOBAL character_set_server = 'utf8mb4';
|
||||
SET GLOBAL collation_server = 'utf8mb4_unicode_ci';
|
||||
EOF
|
||||
# Set InnoDB settings for utf8mb4 support (allows longer keys)
|
||||
# Note: innodb_large_prefix is ON by default in MySQL 8.0
|
||||
# Ensure default row format is DYNAMIC (default in MySQL 8.0, but explicit for clarity)
|
||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||
SET GLOBAL innodb_default_row_format = 'DYNAMIC';
|
||||
EOF
|
||||
# Ensure user exists and has proper privileges
|
||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||
CREATE USER IF NOT EXISTS 'evennia'@'%' IDENTIFIED BY 'password';
|
||||
|
|
@ -58,10 +64,14 @@ runs:
|
|||
GRANT PROCESS ON *.* TO 'evennia'@'%';
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
# Set database character set
|
||||
# Set database character set and default row format
|
||||
mysql -u root -proot_password -h 127.0.0.1 evennia <<EOF
|
||||
ALTER DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
EOF
|
||||
# Set default row format for new tables (needed for long keys with utf8mb4)
|
||||
mysql -u root -proot_password -h 127.0.0.1 evennia <<EOF
|
||||
SET GLOBAL default_storage_engine = 'InnoDB';
|
||||
EOF
|
||||
shell: bash
|
||||
|
||||
# get logs from db start
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ jobs:
|
|||
- python-version: "3.11"
|
||||
coverage-test: true
|
||||
|
||||
timeout-minutes: 10
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
|
|||
4
.github/workflows/mysql_settings.py
vendored
4
.github/workflows/mysql_settings.py
vendored
|
|
@ -48,13 +48,13 @@ DATABASES = {
|
|||
"PORT": "", # use default port
|
||||
"OPTIONS": {
|
||||
"charset": "utf8mb4",
|
||||
"init_command": "set collation_connection=utf8mb4_unicode_ci",
|
||||
"init_command": "SET collation_connection=utf8mb4_unicode_ci, sql_mode='STRICT_TRANS_TABLES'",
|
||||
},
|
||||
"TEST": {
|
||||
"NAME": "evennia",
|
||||
"OPTIONS": {
|
||||
"charset": "utf8mb4",
|
||||
"init_command": "set collation_connection=utf8mb4_unicode_ci",
|
||||
"init_command": "SET collation_connection=utf8mb4_unicode_ci, sql_mode='STRICT_TRANS_TABLES'",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue