Check pg_constraint by conname + conrelid so a same-named CHECK on another table cannot skip creation, add the constraint as NOT VALID and validate separately to avoid a long ACCESS EXCLUSIVE lock at boot. Mark lib/students.js as partially extracted in the migration plan.