CI: More MySQL work

This commit is contained in:
Griatch 2025-12-19 11:37:20 +01:00
parent a2b3559a4c
commit 0660952efd

View file

@ -80,9 +80,14 @@ runs:
- name: Set MySQL table row format after migrations (safety check)
if: ${{ inputs.testing-db == 'mysql' }}
working-directory: testing_mygame
run: |
python -c "import os; import django; os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.conf.settings'); django.setup(); from django.db import connection; cursor = connection.cursor(); cursor.execute(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND ENGINE = 'InnoDB'\"); tables = [row[0] for row in cursor.fetchall()]; [cursor.execute(f'ALTER TABLE \`{table}\` ROW_FORMAT=DYNAMIC') or print(f'Set ROW_FORMAT=DYNAMIC for table {table}') for table in tables]"
mysql -h 127.0.0.1 -u evennia -ppassword evennia -e "
SELECT CONCAT('ALTER TABLE \`', TABLE_NAME, '\` ROW_FORMAT=DYNAMIC;') AS stmt
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'evennia' AND ENGINE = 'InnoDB'
" | grep -v stmt | while read stmt; do
mysql -h 127.0.0.1 -u evennia -ppassword evennia -e "$stmt" 2>/dev/null || true
done
shell: bash
- name: Collect static files