wheels dbmigrate up
Run the next pending database migration.
Synopsis
Description
The dbmigrate up
command executes the next pending migration in your database migration queue. This command is used to incrementally apply database changes one migration at a time, allowing for controlled and reversible database schema updates.
Options
--env
--env
Type: String
Default:
development
Description: The environment to run the migration in (development, testing, production)
--datasource
--datasource
Type: String
Default: Application default
Description: Specify a custom datasource for the migration
--verbose
--verbose
Type: Boolean
Default:
false
Description: Display detailed output during migration execution
--dry-run
--dry-run
Type: Boolean
Default:
false
Description: Preview the migration without executing it
Examples
Run the next pending migration
Run migration in production environment
Preview migration without executing
Use a specific datasource
Use Cases
Incremental Database Updates
When you want to apply database changes one at a time rather than all at once:
Testing Individual Migrations
Test migrations individually before applying all pending changes:
Controlled Production Deployments
Apply migrations incrementally in production for better control:
Notes
Migrations are executed in chronological order based on their timestamps
Each migration is tracked in the database to prevent duplicate execution
Use
wheels dbmigrate info
to see pending and completed migrationsAlways backup your database before running migrations in production
Related Commands
Last updated
Was this helpful?