@cambria-packages/unity-db
v2.8.0
Published
### Development
Downloads
285
Readme
unity-db
Development
Setup local database
Assuming you have docker-compose and make installed:
Start the local PostgreSQL database:
make upThis will use
local-postgres-docker-compose.ymlto start PostgreSQL 17.Dump data from production (if needed):
make dumpRestore dump into local db (if needed):
make restoreConfigure environment:
- Copy
.env.exampleto.env.local - Default local connection values should work unless you changed the docker-compose configuration
- Copy
Database Migrations:
- Write migrations in the
migrationsfolder following chronological order - Test migrations locally with
bun migrate - Commit changes in a PR
- After merge, production db will be automatically migrated
- Write migrations in the
Database Details
- Using PostgreSQL 17
- Default local credentials:
- Host: localhost
- Port: 5432
- User: unity_user
- Password: unity_password
- Database: unity_db
Common Tasks
Reset local database:
make down
make upAccess PostgreSQL CLI:
docker exec -it unity_db_postgres psql -U unity_user -d unity_db