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.
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
postgresservice to the dev Docker Compose with a healthcheck. App container depends on it. Connection viaDATABASE_URLin.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_URLin.env.prod.