Commit

45a8b97

While building a CI check for migrations, I ran this on MySQL 8.4: ALTER TABLE posts ADD COLUMN author_id BIGINT REFERENCES users (id); It succeeded. No warning. No foreign key either. MySQL 8.4 parses an inline REFERENCES and throws it away. I inserted a post by user 999, who does not exist, and it went in. Then I added the key the proper way, and it failed with error 1452 on that orphan row. Schemity's free Migration Check now flags the inline form in the pull request. MySQL 9.0 enforces the clause, so the same migration file builds a key on one version and quietly lets orphans in on the other. https://schemity.com/blog/check-database-migrations-in-ci-without-a-database/
schemity.comChecking Database Migrations in CI: What a Pull Request Check Can Catch Without a Database - SchemitySchemity Migration Check reads a pull request's SQL migrations against the schema the older ones build, with no database: what it catches, and what needs a live one.

commit 45a8b97