Skip to content
Back to skills

4 Database Migration Pattern

ASecurity

Sub-skill of docker: 4. Database Migration Pattern.

  • 17 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
databasesgobashdockerdatabase

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 4-database-migration-pattern --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 4 Database Migration Pattern?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 4 Database Migration Pattern
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-4-database-migration-pattern/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-4-database-migration-pattern)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.