Skip to main content
Devias stores its data in PostgreSQL. Records are kept as JSON, so adding a field never means changing a table.

Embedded database or Postgres

The embedded database is PGlite: Postgres compiled to run inside the server. It is what you get when DATABASE_URL is not set, and its files are kept in apps/server/.data/pglite (change it with PGLITE_DATA_DIR).

Use Postgres

Point the server at a database with DATABASE_URL:
For local work, the repository includes a Docker Compose file with a ready-made Postgres:
It listens on port 5433, with the user, password and database all named devias. It is for development only.

Migrations

The database schema is created and updated by migrations, plain SQL files in apps/server/drizzle.
  • On the embedded database they run automatically when the server starts.
  • On Postgres they don’t, unless you set MIGRATE_ON_BOOT=1. Otherwise, run them yourself before starting a new version:
Back up your database before upgrading, as you would for any application. Everything your team creates is stored there.