Migration start
Skill xataio/nextjs-claude-code-starter/.claude/skills/migration-start
Begin a zero-downtime schema migration using pgrollFrom its SKILL.md
npx -y skills add xataio/nextjs-claude-code-starter --skill migration-startAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, 344 tokens by cl100k_base, as published. Nobody here has run it
Start a migration
Begin a zero-downtime schema migration using pgroll.
Usage
xata roll start <migration-file.yaml>
Example
# Start the migration (expand phase)
xata roll start migrations/002_add_role.yaml
# Test your changes with both old and new schemas running
npm run dev
# ... verify everything works ...
# Complete the migration (contract phase)
xata roll complete
How pgroll works
pgroll uses an expand-contract pattern:
Expand phase (xata roll start)
- Creates new columns/tables
- Sets up views for both old and new schemas
- Installs triggers to keep both in sync
- Both versions of your app work simultaneously
Contract phase (xata roll complete)
- Removes old schema views
- Drops sync triggers
- Cleans up
Migration file format
pgroll migrations are YAML files with declarative operations:
operations:
- add_column:
table: users
column:
name: role
type: text
nullable: false
default: "'member'"
Common operations
create_table— Create a new tableadd_column— Add a column to existing tabledrop_column— Remove a columnrename_column— Rename a columnalter_column— Modify column propertiescreate_index— Add an index
See pgroll documentation for all operations.
Check migration status
xata roll status
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.