CLI Overview
Quick Start Guide
wheels info
wheels reload
wheels deps
wheels destroy
wheels watch
wheels generate app
wheels generate app-wizard
wheels generate controller
wheels generate model
wheels generate view
wheels generate property
wheels generate route
wheels generate resource
wheels generate api-resource
wheels generate frontend
wheels generate test
wheels generate snippets
wheels scaffold
wheels db create
wheels db drop
wheels db setup
wheels db reset
wheels db status
wheels db version
wheels db rollback
wheels db seed
wheels db dump
wheels db restore
wheels db shell
wheels db schema
wheels dbmigrate info
wheels dbmigrate latest
wheels dbmigrate up
wheels dbmigrate down
wheels dbmigrate reset
wheels dbmigrate exec
wheels dbmigrate create blank
wheels dbmigrate create table
wheels dbmigrate create column
wheels dbmigrate remove table
wheels test
wheels test run
wheels test coverage
wheels test debug
wheels config list
wheels config set
wheels config env
wheels env
wheels env setup
wheels env list
wheels env switch
wheels environment
wheels console
wheels runner
wheels server
wheels server start
wheels server stop
wheels server restart
wheels server status
wheels server log
wheels server open
wheels plugins
wheels plugins list
wheels plugins install
wheels plugins remove
wheels analyze
wheels analyze code
wheels analyze performance
wheels analyze security
wheels security
wheels security scan
wheels optimize
wheels optimize performance
wheels docs
wheels docs generate
wheels docs serve
wheels ci init
wheels docker init
wheels docker deploy
wheels deploy
wheels deploy audit
wheels deploy exec
wheels deploy hooks
wheels deploy init
wheels deploy lock
wheels deploy logs
wheels deploy proxy
wheels deploy push
wheels deploy rollback
wheels deploy secrets
wheels deploy setup
wheels deploy status
wheels deploy stop
Configuration Management
Creating Commands
Service Architecture
Migrations Guide
Testing Guide
Object Relational Mapping
Creating Records
Reading Records
Updating Records
Deleting Records
Column Statistics
Dynamic Finders
Getting Paginated Data
Associations
Nested Properties
Object Validation
Object Callbacks
Calculated Properties
Transactions
Dirty Records
Soft Delete
Automatic Time Stamps
Using Multiple Data Sources
dbmigrate exec
Execute a specific database migration by version number.
Synopsis
wheels dbmigrate exec version=<version>
Alias: wheels db exec
Description
The dbmigrate exec
command allows you to migrate to a specific version identified by its version number, regardless of the current migration state. This is useful for moving to any specific point in your migration history.
Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| version
| string | Yes | Version to migrate to |
Examples
Execute a specific migration
wheels dbmigrate exec version=20240115123456
Migrate to version 0 (revert all migrations)
wheels dbmigrate exec version=0
Use Cases
Migrating to a Specific Version
Move to any point in migration history:
# Check current status
wheels dbmigrate info
# Migrate to specific version
wheels dbmigrate exec version=20240115123456
Rolling Back to Previous Version
Move to an earlier migration state:
# Check migration history
wheels dbmigrate info
# Go back to specific version
wheels dbmigrate exec version=20240101000000
Reset Database
Clear all migrations:
# Migrate to version 0
wheels dbmigrate exec version=0
# Verify empty state
wheels dbmigrate info
Important Considerations
Migration Order
Executing migrations out of order can cause issues if migrations have dependencies. Always ensure that any required preceding migrations have been run.
Version Tracking
The command updates the migration tracking table to reflect the execution status.
Best Practices
- Check Dependencies: Ensure required migrations are already applied
- Test First: Run in development/testing before production
- Use Sparingly: Prefer normal migration flow with up/latest
- Document Usage: Record when and why specific executions were done
- Verify State: Check migration status before and after execution
Version Number Format
Migration versions are typically timestamps in the format:
YYYYMMDDHHmmss
(e.g., 20240115123456)- Year: 2024
- Month: 01
- Day: 15
- Hour: 12
- Minute: 34
- Second: 56
Notes
- The command will migrate UP or DOWN to reach the specified version
- Version must be a valid migration version or 0 to reset all
- The migration file must exist in the migrations directory
- The command displays the migration progress message
- Both up() and down() methods should be defined in the migration
Related Commands
wheels dbmigrate up
- Run the next migrationwheels dbmigrate down
- Rollback last migrationwheels dbmigrate latest
- Run all pending migrationswheels dbmigrate info
- View migration statuswheels dbmigrate create blank
- Create a new migration
- Synopsis
- Parameters
- Examples
- Execute a specific migration
- Migrate to version 0 (revert all migrations)
- Use Cases
- Migrating to a Specific Version
- Rolling Back to Previous Version
- Reset Database
- Important Considerations
- Migration Order
- Version Tracking
- Best Practices
- Version Number Format
- Notes
- Related Commands