Deploys the database layer to Railway including PostgreSQL, Qdrant vector store, and Redis. Use this skill when the user wants to deploy PostgreSQL to Railway, run database migrations on Railway, deploy Qdrant to Railway, deploy Redis to Railway, or verify all database services are healthy before deploying backend services. Trigger when the user mentions "Railway database", "deploy PostgreSQL Railway", "Railway migrations", "Railway Qdrant", "Railway Redis", "database layer deployment", or wants to implement Stage 8B (Railway DB) after Railway setup is complete.
Deploy the complete database layer to Railway: managed PostgreSQL (with migrations and seed data), Qdrant vector store, and Redis cache. All three must be healthy before any backend services are deployed.
⚠️ Deploy in order: PostgreSQL first → run migrations → Qdrant → Redis. Do NOT deploy backend before all DB services are healthy.
docs/05_deployment_plan.md existsinfra/migrations/001_initial_schema.sqlinfra/migrations/002_add_indexes.sqlinfra/migrations/003_seed_data.sqlCtrl+Shift+I / Cmd+Shift+I)docs/05_deployment_plan.md
Deploy the database layer to Railway.
Task 1 — PostgreSQL (Railway Managed):
- Add Railway PostgreSQL plugin to project
- Get DATABASE_URL from Railway dashboard
- Update all services to use DATABASE_URL
- Run migrations in order:
001_initial_schema.sql
002_add_indexes.sql
003_seed_data.sql
- Verify: 11 tables created, seed data present
Task 2 — Qdrant:
- Deploy Qdrant using Docker image: qdrant/qdrant:v1.13.6
- Set Railway service name: qdrant
- Set volume for persistence: /qdrant/storage
- Verify: GET /health returns {"status":"ok"}
Task 3 — Redis:
- Add Railway Redis plugin to project
- Get REDIS_URL from Railway dashboard
- Update rag_service and backend to use REDIS_URL
- Verify: PING returns PONG
Provide step-by-step Railway dashboard instructions.
Do NOT deploy backend services yet.
DATABASE_URLDATABASE_URL in all service Variables that need DB accessAfter PostgreSQL is healthy, run migrations via Railway shell or local psql:
# Option A: Railway CLI
railway run psql $DATABASE_URL -f infra/migrations/001_initial_schema.sql
railway run psql $DATABASE_URL -f infra/migrations/002_add_indexes.sql
railway run psql $DATABASE_URL -f infra/migrations/003_seed_data.sql
# Option B: Local psql pointing to Railway DB
psql $DATABASE_URL -f infra/migrations/001_initial_schema.sql
psql $DATABASE_URL -f infra/migrations/002_add_indexes.sql
psql $DATABASE_URL -f infra/migrations/003_seed_data.sql
Verify tables created:
psql $DATABASE_URL -c "\dt"
# Expected: 11 tables listed
qdrant/qdrant:v1.13.6qdrant/qdrant/storagecurl https://[qdrant-railway-url]/health
# Expected: {"status":"ok"}
railway run psql $DATABASE_URL -c "SELECT COUNT(*) FROM users;"
# Expected: 4 (seeded test users)
railway run psql $DATABASE_URL -c "\dt"
# Expected: 11 tables
curl https://[qdrant-url]/health
# Expected: {"status":"ok"}
railway run redis-cli -u $REDIS_URL PING
# Expected: PONG
| Item | Check |
|---|---|
| PostgreSQL service deployed on Railway | ☐ |
| DATABASE_URL set in all service variables | ☐ |
| Migration 001 applied | ☐ |
| Migration 002 applied | ☐ |
| Migration 003 (seed data) applied | ☐ |
| 11 tables confirmed | ☐ |
| 4 seed users confirmed | ☐ |
| Qdrant deployed (v1.13.6) | ☐ |
| Qdrant /health returns ok | ☐ |
| Qdrant volume mounted | ☐ |
| Redis deployed | ☐ |
| REDIS_URL set in service variables | ☐ |
| Redis PING returns PONG | ☐ |
Railway PostgreSQL ✅ (11 tables, seed data)
Railway Qdrant ✅ (v1.13.6, healthy)
Railway Redis ✅ (healthy)
Ready for Stage 8C (Backend deployment) ✅
docs/05_deployment_plan.md attached