Skip to content

Migrate from SQLite to PostgreSQL #558

@chetanr25

Description

@chetanr25

Migrate from SQLite to PostgreSQL

Context

Discussion: https://github.com/orgs/fireform-core/discussions/540

FireForm currently uses SQLite. This doesn't scale for concurrent writes (multiple gunicorn workers) and offers no durability guarantees in Docker. Decision is to migrate to PostgreSQL.

Scope

Database layer - Replace SQLite with PostgreSQL using SQLAlchemy (connection, models, init_db()). No data migration needed; fresh schema creation on startup is sufficient.

Development setup - Add a postgres service to the dev Docker Compose with a healthcheck. App container depends on it. Connection via DATABASE_URL in .env.dev.

Production setup - No PostgreSQL service in prod compose. Users provide their own PostgreSQL instance (managed service, self-hosted, or separate Docker Compose their choice). Only requirement is a valid DATABASE_URL in .env.prod.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Week X Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions