Rollback Command
Rollback one or more assets to their previous version.
Usage
Single Asset
msh rollback orders
Multiple Assets
msh rollback orders,revenue,users
All Assets
msh rollback --all
Options
--env <name>
Specify the target environment (defaults to dev).
# Development environment (Git-aware schemas)
msh rollback --env dev orders
# Production environment (Fixed schemas)
msh rollback --env prod orders
Environment Behavior:
dev(default): Uses Git-aware schemas. Each git branch gets isolated schemasprod: Uses fixed schemas without git suffixes
See Git-Aware Schemas for more details.
How It Works
- Finds the previous successful deployment for each asset
- Checks if the backup table exists
- Swaps the view to point to the previous version
- Shows a summary of successes and failures
Output Example
Rolling back 'orders' to version a1b2c3 (from 2024-01-15 10:30:00)...
[OK] Rolled back 'orders' to version a1b2c3.
Rolling back 'revenue' to version d4e5f6 (from 2024-01-15 09:15:00)...
[OK] Rolled back 'revenue' to version d4e5f6.
Rollback Summary: 2/2 succeeded
warning
Rollback is instantaneous but destructive to the current Blue state. The current production schema becomes the new archive. Use with caution in production environments.