Database Management Guide
Docklift uses SQLite as its database, managed by Prisma ORM.
Schema Location
The Prisma schema is located at:
backend/prisma/schema.prisma
Core Commands
Run these commands from the backend/ directory:
View Data
- •Open Studio:
Opens a web GUI to view and edit the database content.bash
bun run db:studio
Schema Changes
- •Edit Schema: Modify
backend/prisma/schema.prisma. - •Generate Client:
Updates the generated TypeScript client inbash
bun run db:generate
node_modules. - •Push Changes:
Applies the schema changes to the local SQLite database file (bash
bun run db:push
backend/prisma/dev.dbor similar).
Reset
- •Reset Database:
WARNING: This will delete all data.bash
bun run db:push --force-reset
Key Models
- •User: Admin users for the application.
- •Project: Represents a deployed application (container).
- •Deployment: History of builds/deploys for a project.
- •EnvVariable: Environment variables for projects.
- •Settings: System-wide settings.
Troubleshooting
- •If the database seems out of sync with the client, run
bun run db:generate. - •If you encounter migration errors,
db:pushusually resolves dev inconsistencies for SQLite.