Back to skills
SKILL.md
4 Database Migration Pattern
ASecuritySub-skill of docker: 4. Database Migration Pattern.
- 17 stars
- 0 votes
- 0 copies
- 3 views
- Added September 9, 2026
Security analysis
100/100npx -y skills add vamseeachanta/workspace-hub --skill 4-database-migration-pattern --agent claude-codeAre you the author of 4 Database Migration Pattern?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-4-database-migration-pattern)---
name: docker-4-database-migration-pattern
description: 'Sub-skill of docker: 4. Database Migration Pattern.'
version: 1.0.0
category: operations
type: reference
scripts_exempt: true
---
# 4. Database Migration Pattern
## 4. Database Migration Pattern
**Migration Service:**
```yaml
# docker-compose.yml
services:
migrate:
build:
context: .
dockerfile: Dockerfile
command: npm run migrate
environment:
- DATABASE_URL=postgres://user:pass@db:5432/mydb
depends_on:
db:
condition: service_healthy
profiles:
- migrate # Only run when explicitly requested
seed:
build:
context: .
dockerfile: Dockerfile
command: npm run seed
environment:
- DATABASE_URL=postgres://user:pass@db:5432/mydb
depends_on:
- migrate
profiles:
- seed
```
**Usage:**
```bash
# Run migrations
docker compose --profile migrate up migrate
# Run migrations and seed
docker compose --profile migrate --profile seed up
```
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.