diff --git a/tests/test_monitor_column_migration.py b/tests/test_monitor_column_migration.py index bb1967a..b104e3d 100644 --- a/tests/test_monitor_column_migration.py +++ b/tests/test_monitor_column_migration.py @@ -34,7 +34,12 @@ def _ddl(column: Column) -> str: def test_column_renders_as_ddl(column): ddl = db._column_ddl(column) - assert ddl.startswith(column.name) + # SQLAlchemy back-quotes an identifier only when it has to, so the rendered + # name matches the column's with the quoting stripped -- which is the case for + # reserved words like monitor_run.trigger. That quoting is a feature: the + # hand-kept list this replaced would have emitted bare `trigger` and died on a + # syntax error. + assert ddl.split(" ", 1)[0].strip("`") == column.name # MySQL refuses AUTO_INCREMENT together with the DEFAULT this helper appends # to NOT NULL columns. assert "AUTO_INCREMENT" not in ddl