Skip to content

shiva migrate

Run, roll back, and inspect database migrations.

Usage

bash
shiva migrate [options]

Commands

Run all pending migrations

bash
shiva migrate

Check status

bash
shiva migrate --status

Output:

Module              Migration                           Status
shiva-player        001_create_players                  ✓ ran (2024-01-15)
shiva-player        002_add_metadata                    ✓ ran (2024-01-15)
shiva-economy       001_create_accounts                 ✓ ran (2024-01-15)
my-fishing          001_create_fishing_logs             ⏳ pending

Roll back last batch

bash
shiva migrate --rollback

Roll back N steps

bash
shiva migrate --rollback --steps 3

Run for one module only

bash
shiva migrate --module my-fishing

Reset all migrations (destructive!)

bash
shiva migrate --reset --force

Options

FlagDescription
--statusShow migration status
--rollbackRoll back last batch
--steps NNumber of steps to roll back
--module <name>Run for a specific module only
--destructiveAllow destructive operations (DROP, etc.)
--resetRoll back all migrations
--forceSkip confirmation prompt
--dry-runPrint SQL without executing

Released under the MIT License.