Fix SQLAlchemy 2.x compatibility in Alembic migrations (sa.true_ → sa.True_) #79
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#79
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Plan
plan-2026-02-26-tf-modularize-postgres-- Phase 3, Part B step 5 ("Fix SQLite-isms in migration files")Repo
forgejo_admin/pal-e-docsUser Story
As a platform operator
I want Alembic migrations to run cleanly against Postgres
So that the SQLite-to-Postgres migration can proceed
Context
Phase 3 of the Postgres plan requires running
alembic upgrade headagainst a fresh Postgres database. Two migration files usesa.true_()which was deprecated/removed in SQLAlchemy 2.x — the correct API issa.True_()(capital T). This causesAttributeError: module 'sqlalchemy' has no attribute 'true_'when running migrations against Postgres.The first two migrations (initial schema, repos table) ran successfully. The users table migration fails.
File Targets
Files the agent should modify:
alembic/versions/b2c3d4e5f6a7_add_users_table.pyline 26 —sa.true_()→sa.True_()alembic/versions/c3d4e5f6a7b8_add_project_is_public_and_page_note_fk.pyline 23 —sa.true_()→sa.True_()Files the agent should NOT touch:
Acceptance Criteria
sa.true_()replaced withsa.True_()in both filesTest Expectations
alembic upgrade headcompletes without errors against PostgresPALDOCS_DATABASE_URL=postgresql://paledocs:PfyJMdX4mPJF8eyYS38l@127.0.0.1:5432/paledocs .venv/bin/alembic upgrade headalembic downgrade basefirst if needed, or drop and recreate.Constraints
sa.True_()andsa.False_()are the correct formsChecklist
Related
plan-2026-02-26-tf-modularize-postgresPhase 3 — this blocks data migration