Fix sa.true_() -> sa.True_() for SQLAlchemy 2.x compatibility #80
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-api!80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "79-fix-alembic-sa-true"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes
AttributeError: module 'sqlalchemy' has no attribute 'true_'when running Alembic migrations against Postgres. Two-character fix:sa.true_()tosa.True_()in two migration files.Changes
alembic/versions/b2c3d4e5f6a7_add_users_table.py:sa.true_()changed tosa.True_()on line 26alembic/versions/c3d4e5f6a7b8_add_project_is_public_and_page_note_fk.py:sa.true_()changed tosa.True_()on line 23Test Plan
sa.True_()is valid in SQLAlchemy 2.0.46alembic upgrade headReview Checklist
Related Notes
plan-2026-02-26-tf-modularize-postgres-- Phase 3 blocker (step 5: fix SQLite-isms)PR #80 Review
BLOCKERS
None.
NITS
alembic upgrade head). This is expected for a pre-migration PR and not a blocker -- the fix will be verified as part of the Phase 3 Postgres migration deployment.SOP COMPLIANCE
79-fix-alembic-sa-truereferences issue #79)plan-2026-02-26-tf-modularize-postgres)CODE REVIEW
The fix is correct.
sa.true_()(lowercase) is a SQLAlchemy 1.x function-style API that was removed or relocated in SQLAlchemy 2.x.sa.True_()(capitalized) is the proper SQLAlchemy 2.xColumnElementconstant for boolean TRUE server defaults. Both changed files are Alembic migration scripts usingserver_default=for boolean columns, which is the exact context where this matters for Postgres compatibility.Diff is minimal and surgical -- two identical one-character capitalization fixes across two migration files. No risk of side effects.
VERDICT: APPROVED