Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

fix(application): quote column names in CheckConstraint for PostgreSQL#233

Merged
karaktaka merged 1 commit into
mainfrom
fix/postgresql-check-constraint-quoting
Feb 22, 2026
Merged

fix(application): quote column names in CheckConstraint for PostgreSQL#233
karaktaka merged 1 commit into
mainfrom
fix/postgresql-check-constraint-quoting

Conversation

@karaktaka
Copy link
Copy Markdown
Contributor

@karaktaka karaktaka commented Feb 22, 2026

Summary

  • Quote PascalCase column names in CheckConstraint SQL expressions with double-quotes so PostgreSQL doesn't fold them to lowercase
  • Fixes UndefinedColumn: column "requiredapprovals" does not exist crash on startup with PostgreSQL
  • Affects three constraints: ck_form_required_approvals, ck_form_required_denials, ck_template_builtin_guild

Test plan

  • All 632 existing tests pass
  • Ruff lint and format checks pass
  • Audited full codebase (models, migrations, queries) — no other unquoted raw SQL references to PascalCase columns
  • Deploy to PostgreSQL environment and verify bot starts without CREATE TABLE errors

🤖 Generated with Claude Code

…or PostgreSQL

PostgreSQL folds unquoted identifiers to lowercase, causing CREATE TABLE
to fail with "column requiredapprovals does not exist" when the actual
column is "RequiredApprovals". Add double-quotes around all column
references in CheckConstraint SQL expressions.

Co-Authored-By: Claude <noreply@anthropic.com>
@karaktaka karaktaka merged commit 0b982f0 into main Feb 22, 2026
6 checks passed
@karaktaka karaktaka deleted the fix/postgresql-check-constraint-quoting branch February 22, 2026 16:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant