fix: let MySQL create the schema's triggers in CI - #909
Conversation
docker_run.sh runs migrate:fresh --seed as the container starts, so CI setting log_bin_trust_function_creators afterwards in "Setup application" is too late: recreate_repair_status_triggers has already failed with ERROR 1419, and migrate stopped there. Today that migration is the last one, so nothing is skipped and the only consequence is that CI has been running without the repair_status triggers. The next migration added after it would be silently skipped, which is how it surfaced - on the Nuxt branch, as an unexplained 500 from a column that should have existed. Setting it in the mounted my.cnf applies from server start, before anything migrates. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
|
Verified the runtime effect rather than just that the file parses — started a stock Binary logging is on, which is the condition that triggers ERROR 1419, and a non-SUPER user creates a trigger successfully — the exact case that fails in CI today. |
|
Green, which answers the thing worth watching: the full suite passes with the repair_status triggers now actually being created. Nothing had been passing because they were absent — CI was simply running without them. So this is a straight gain: the triggers are exercised again, and the next migration added after |



What's wrong
docker_run.shrunsmigrate:fresh --seedas the app container starts. CI setslog_bin_trust_function_creators = 1afterwards, in "Setup application" — by which pointrecreate_repair_status_triggershas already failed:migratestops at the first failure, so every migration after that one is silently skipped.On
developtoday the trigger migration happens to be the last one, so nothing is skipped and the only consequence is that CI has been running without the repair_status triggers. It's the next migration added after it that gets silently dropped — which is exactly how this surfaced, on the Nuxt branch, as an unexplained 500 from a column that should have existed.The fix
Set it in the mounted
mysql/my.cnf, so it applies from server start rather than after the app has already migrated. Verified withmysqld --validate-config. This also fixes local reseeds, which need the sameSET GLOBALby hand today.Worth watching on this PR
Creating the triggers restores behaviour CI hasn't had, so if any test has been passing because the triggers were missing, it'll fail here. That would be worth knowing either way — a green run means the triggers were simply absent for no benefit.
The now-redundant
SET GLOBALin "Setup application" is left alone; it's harmless and still covers anyone running an older database container.🤖 Generated with Claude Code