Repository navigation
Data and backup
mcinquin edited this page Oct 12, 2026
·
1 revision
MarkIt stores all application state in PostgreSQL (Docker volume postgres_data). There are no local SQLite files or uploaded media directories to back up beyond the database.
User → user account
Team → team with invite code
TeamMember → user↔team membership (role: OWNER/ADMIN/MEMBER)
Phrase → phrase bank entry (isDefault=true for shared phrases)
BingoCard → bingo board (rows × cols, freeCenter)
Cell → board cell (phrase + position)
CheckedCell → checked cell (by which user, when)
Migrations live under prisma/migrations/. The Docker entrypoint runs prisma migrate deploy then seeds default phrases (and the admin account when ADMIN_* is set).
npm run db:migrate:deploy # Apply migrations (prod / Docker)
npm run db:migrate # Create a migration (dev)
npm run db:push # Sync schema without a migration (prototyping)
npm run db:seed # Load phrases + admin if configured
npm run db:studio # Open Prisma Studio
npm run db:generate # Regenerate the Prisma clientRun dumps on the host against the markit_db container. Keep scripts/cron local — they are not versioned in this repository.
docker exec markit_db pg_dump -U markit markit > backup_$(date +%Y%m%d).sqlDaily cron example:
0 3 * * * docker exec markit_db pg_dump -U markit markit > /var/backups/markit/backup_$(date +\%Y\%m\%d).sqlStop writers (or the app), then restore:
docker compose stop app
docker exec -i markit_db psql -U markit markit < backup_YYYYMMDD.sql
docker compose start appFor a clean restore into an empty database, drop/recreate the DB first or restore into a fresh volume.