원클릭으로
database-migration
Database migrations with Alembic, rollbacks, and zero-downtime deployment. Use for schema changes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Database migrations with Alembic, rollbacks, and zero-downtime deployment. Use for schema changes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Tool-agnostic search — query construction, tool selection, source trust hierarchy.
Auto-continue through todos with idle detection and safety gates. Use for multi-step orchestration.
Level 2 — Pantheon-native context compression with priority scoring, semantic summarization, downstream-aware compression, budget allocation, and cross-references
Automated visual review pipeline — Playwright screenshots, self-analysis, fix loop, escalation. Used by Aphrodite for UI verification.
Multi-agent orchestration with model routing, category delegation, and sprint management. Use for coordinating Pantheon agents.
MCP security hardening — credential leakage prevention, input sanitization, and tool access control. Use for reviewing agent MCP configurations.
| name | database-migration |
| description | Database migrations with Alembic, rollbacks, and zero-downtime deployment. Use for schema changes. |
| globs | ["**/alembic/**","**/migrations/**"] |
| alwaysApply | false |
alembic revision --autogenerate -m "Add user preferences"
# File: alembic/versions/001_add_user_preferences.py
def upgrade():
op.create_table('user_preferences',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('theme', sa.String(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id']),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('user_preferences')
def upgrade():
op.create_table(...)
# Add indexes for performance
op.create_index(
'ix_user_preferences_user_id',
'user_preferences',
['user_id']
)
def downgrade():
op.drop_index('ix_user_preferences_user_id')
op.drop_table('user_preferences')
# Test upgrade
alembic upgrade head
# Verify data integrity
SELECT * FROM user_preferences;
# Test downgrade
alembic downgrade -1
# Verify
SELECT COUNT(*) FROM user_preferences; # Should error
# Backup production
pg_dump production > backup.sql
# Load to staging
psql staging < backup.sql
# Run migration
alembic upgrade head
# Performance test
EXPLAIN ANALYZE SELECT * FROM user_preferences WHERE user_id = 123;
# Strategy 1: Expand-Contract
# 1. Add new column (backward compatible)
# 2. Backfill data
# 3. Deploy code to use new column
# 4. Drop old column
# Strategy 2: Blue-Green
# 1. Deploy new schema to green DB
# 2. Sync data
# 3. Switch traffic to green
# 4. Keep blue as rollback option
001_initial_schema.pyALWAYS test downgrade first:
alembic current # See current version
alembic downgrade -1 # Go back 1 version
alembic upgrade +2 # Forward 2 versions