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 reset
Reset all database migrations by migrating to version 0.
Synopsis
wheels dbmigrate reset
Alias: wheels db reset
Description
The dbmigrate reset
command resets your database by migrating to version 0, effectively rolling back all executed migrations. This is useful during development when you need to start fresh.
Parameters
None.
Examples
Reset all migrations
wheels dbmigrate reset
This will migrate the database to version 0, rolling back all migrations.
Use Cases
Fresh Development Database
Start with a clean slate during development:
# Reset all migrations
wheels dbmigrate reset
# Re-run all migrations
wheels dbmigrate latest
# Seed with test data
wheels db seed
Testing Migration Sequence
Verify that all migrations run correctly from scratch:
# Reset all migrations
wheels dbmigrate reset
# Run migrations one by one to test
wheels dbmigrate up
wheels dbmigrate up
# ... continue as needed
Fixing Migration Order Issues
When migrations have dependency problems:
# Reset all migrations
wheels dbmigrate reset
# Manually fix migration files
# Re-run all migrations
wheels dbmigrate latest
Continuous Integration Setup
Reset database for each test run:
# CI script
wheels dbmigrate reset
wheels dbmigrate latest
wheels test run
Important Warnings
Data Loss
WARNING: This command will result in complete data loss as it rolls back all migrations. Always ensure you have proper backups before running this command, especially in production environments.
Production Usage
Using this command in production is strongly discouraged. If you must use it in production:
- Take a complete database backup
- Put the application in maintenance mode
- Have a rollback plan ready
Migration Dependencies
The reset process rolls back migrations in reverse chronological order. Ensure all your down() methods are properly implemented.
Best Practices
- Development Only: Primarily use this command in development environments
- Backup First: Always backup your database before resetting
- Test Down Methods: Ensure all migrations have working down() methods
- Document Usage: If used in production, document when and why
Process Flow
- Displays "Resetting Database Schema"
- Executes
dbmigrate exec version=0
- Automatically runs
dbmigrate info
to show the reset status
Notes
- The command will fail if any migration's down() method fails
- Migration files must still exist for rollback to work
- The migration tracking table itself is preserved
- Use
wheels dbmigrate info
after reset to verify status
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 db seed
- Seed the database with data