fix: quote NM/NN column names in CHECK constraints to match quoted identifiers

This commit is contained in:
Dwindi Ramadhana
2026-03-22 09:28:29 +07:00
parent 92099f0f78
commit de592d140e

View File

@@ -170,13 +170,13 @@ class Session(Base):
Index("ix_sessions_website_id", "website_id"),
Index("ix_sessions_tryout_id", "tryout_id"),
Index("ix_sessions_is_completed", "is_completed"),
# Score constraints [0, 1000]
# Score constraints [0, 1000] - quote column names to match quoted identifiers
CheckConstraint(
"NM IS NULL OR (NM >= 0 AND NM <= 1000)",
'"NM" IS NULL OR ("NM" >= 0 AND "NM" <= 1000)',
"ck_nm_range",
),
CheckConstraint(
"NN IS NULL OR (NN >= 0 AND NN <= 1000)",
'"NN" IS NULL OR ("NN" >= 0 AND "NN" <= 1000)',
"ck_nn_range",
),
# IRT theta constraint [-3, +3]