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 character_set_server = 'utf8mb4';
|
||||||
SET GLOBAL collation_server = 'utf8mb4_unicode_ci';
|
SET GLOBAL collation_server = 'utf8mb4_unicode_ci';
|
||||||
EOF
|
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
|
# Ensure user exists and has proper privileges
|
||||||
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
mysql -u root -proot_password -h 127.0.0.1 mysql <<EOF
|
||||||
CREATE USER IF NOT EXISTS 'evennia'@'%' IDENTIFIED BY 'password';
|
CREATE USER IF NOT EXISTS 'evennia'@'%' IDENTIFIED BY 'password';
|
||||||
|
|
@ -58,10 +64,14 @@ runs:
|
||||||
GRANT PROCESS ON *.* TO 'evennia'@'%';
|
GRANT PROCESS ON *.* TO 'evennia'@'%';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
EOF
|
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
|
mysql -u root -proot_password -h 127.0.0.1 evennia <<EOF
|
||||||
ALTER DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
ALTER DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
EOF
|
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
|
shell: bash
|
||||||
|
|
||||||
# get logs from db start
|
# get logs from db start
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- python-version: "3.11"
|
- python-version: "3.11"
|
||||||
coverage-test: true
|
coverage-test: true
|
||||||
|
|
||||||
timeout-minutes: 10
|
timeout-minutes: 30
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
"PORT": "", # use default port
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"charset": "utf8mb4",
|
"charset": "utf8mb4",
|
||||||
"init_command": "set collation_connection=utf8mb4_unicode_ci",
|
"init_command": "SET collation_connection=utf8mb4_unicode_ci, sql_mode='STRICT_TRANS_TABLES'",
|
||||||
},
|
},
|
||||||
"TEST": {
|
"TEST": {
|
||||||
"NAME": "evennia",
|
"NAME": "evennia",
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"charset": "utf8mb4",
|
"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