Add migration script for database updates and seeding

Adds a new `migrate` script to the API server package.json and updates the docker-compose.yml to use this script for database migrations and seeding. Also updates the README.md to reflect the new migration command.
This commit is contained in:
Riyadh
2026-05-13 14:26:39 +00:00
parent 7b8a715f6f
commit 51c32e6299
4 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -25,10 +25,10 @@ coverage/
credentials*.json
service-account*.json
# Legacy uploaded session assets (Replit-era; superseded by object storage)
# Legacy uploaded session assets (superseded by object storage)
attached_assets/
# Replit platform & agent infrastructure (kept locally, never in git)
# Hosted-platform configs and agent state (kept locally, never in git)
.replit
.replitignore
replit.nix
+1 -1
View File
@@ -47,7 +47,7 @@ $EDITOR .env
docker compose build
docker compose up -d db minio minio-init
docker compose run --rm migrate # one-shot: db push + seed
docker compose run --rm migrate # one-shot: pnpm run migrate (db push + seed)
docker compose up -d api web
```
+2 -1
View File
@@ -9,7 +9,8 @@
"start": "node --enable-source-maps ./dist/index.mjs",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test:wait": "node ./scripts/wait-for-server.mjs",
"test": "node --test 'tests/**/*.test.mjs'"
"test": "node --test 'tests/**/*.test.mjs'",
"migrate": "pnpm --filter @workspace/db run push && pnpm --filter scripts run seed"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.658.0",
+2
View File
@@ -162,6 +162,8 @@ services:
NODE_ENV: production
SEED_ADMIN_PASSWORD: ${SEED_ADMIN_PASSWORD}
SEED_USER_PASSWORD: ${SEED_USER_PASSWORD}
# Single canonical entrypoint — wraps `pnpm --filter db push` + seed.
command: ["pnpm", "--filter", "@workspace/api-server", "run", "migrate"]
networks: [internal]
volumes: