• Aryan Noshirvnai's avatar
    Move prod's primary datastore from SQLite to PostgreSQL · 4b5c72cd
    Aryan Noshirvnai authored
    SQLite was only ever meant for testing; prod now has real concurrent
    features (Rooms/DM chat, websockets) that benefit from proper
    multi-writer concurrency. Migrations were already dialect-agnostic (no
    op.batch_alter_table or sqlite_* kwargs anywhere), so this was a clean
    schema-only cutover - prod had zero real users, so nothing needed
    migrating, just a fresh `alembic upgrade head` against an empty Postgres
    database.
    
    Also fixed two real SQLite-only assumptions in database.py that the
    Postgres cutover exposed: `connect_args={"check_same_thread": False}`
    applied unconditionally (psycopg has no such option and raises on it),
    and the db-directory-creation logic ran DATABASE_URL through a
    sqlite-only string replace regardless of dialect. Both now scoped to an
    `_is_sqlite` check, matching the existing WAL-pragma guard.
    
    deploy.sh's automated .env regeneration path also had a silent
    `sqlite:///...` fallback for DATABASE_URL - removed in favor of a hard
    failure (same posture as JWT_SECRET) so a future CI deploy can never
    quietly revert prod back to SQLite by omission.
    
    Redis was considered (explicitly asked about) and deliberately not
    added: the only in-memory real-time state in Rooms/DMs is live
    WebSocket objects (can't live in Redis regardless, tied to one
    process's event loop) and small per-room ephemeral lists already
    documented as intentionally discardable - Redis's actual value only
    appears once there's more than one backend process, which isn't the
    case yet.
    Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
    4b5c72cd
Name
Last commit
Last update
alembic Loading commit data...
deploy Loading commit data...
scripts Loading commit data...
src Loading commit data...
tests Loading commit data...
.env.example Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
Dockerfile Loading commit data...
README.md Loading commit data...
alembic.ini Loading commit data...
docker-compose.yml Loading commit data...
requirements-remix.txt Loading commit data...
requirements.txt Loading commit data...
setup.sh Loading commit data...