Database Setup
Configure your database with Prisma ORM
ATStatus uses Prisma ORM for database access, supporting SQLite, PostgreSQL, and MySQL.
Supported Databases
SQLite
Default, no setup required
PostgreSQLRecommended
Recommended for production
MySQL
Full support
SQLite (Default)
SQLite requires no additional setup:
DATABASE_URL="file:./dev.db"
Development Only: SQLite is great for development but consider PostgreSQL for production.
PostgreSQL
Connection String
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
Example
DATABASE_URL="postgresql://postgres:mysecretpassword@localhost:5432/atstatus?schema=public"
With SSL (Production)
DATABASE_URL="postgresql://user:pass@host:5432/db?schema=public&sslmode=require"
MySQL
Connection String
DATABASE_URL="mysql://USER:PASSWORD@HOST:PORT/DATABASE"
Example
DATABASE_URL="mysql://root:password@localhost:3306/atstatus"
Database Migrations
Development
# Push schema changes directly
npx prisma db push
Production
# Apply migrations
npx prisma migrate deploy
Backup & Restore
SQLite
# Backup
cp prisma/dev.db prisma/backup.db
# Restore
cp prisma/backup.db prisma/dev.db
PostgreSQL
# Backup
pg_dump -U postgres atstatus > backup.sql
# Restore
psql -U postgres atstatus < backup.sql
