Command Line Tools
wheels dbmigrate info
wheels dbmigrate info
Section titled “wheels dbmigrate info”Display database migration status and information.
Synopsis
Section titled “Synopsis”wheels dbmigrate infoAlias: wheels db info
Description
Section titled “Description”The wheels dbmigrate info command shows the current state of database migrations, including which migrations have been run, which are pending, and the current database version.
Parameters
Section titled “Parameters”None.
Output
Section titled “Output”The command displays:
- Datasource: The database connection being used
- Database Type: The type of database (MySQL, PostgreSQL, H2, MSSQL(SQL Server), Oracle.)
- Total Migrations: Count of all migration files found
- Available Migrations: Number of pending migrations
- Current Version: The latest migration that has been run
- Latest Version: The newest migration available
- Migration List: All migrations with their status (migrated or pending)
Example Output
Section titled “Example Output”Database Information--------------------------------------------------Datasource: dbapp_testDatabase Type: MySQL
Migration Status--------------------------------------------------Total Migrations: 17Available Migrations: 14Current Version: 20260116163515Latest Version: 20260123185445--------------------------------------------------
Migration Files--------------------------------------------------╔══════════╤══════════════════════════════════════════════════════╗║ STATUS │ FILE ║╠══════════╪══════════════════════════════════════════════════════╣║ │ 20260123185445_cli_create_table_user ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260123183026_cli_remove_table_blog_posts ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260123182948_create_blog_posts_table ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260122173254_cli_create_table_user_roles ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260119145114_cli_create_column_parts_feature ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260119144642_cli_blank_students ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260119112924_cli_create_table_students ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260119111943_cli_create_table_books ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116170453_cli_create_table_users ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116170311_cli_create_table_users ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116165727_cli_create_column_user_required_field ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116164432_cli_create_column_product_price ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116164211_cli_create_column_user_bio ║╟──────────┼──────────────────────────────────────────────────────╢║ │ 20260116163907_cli_create_column_user_email ║╟──────────┼──────────────────────────────────────────────────────╢║ migrated │ 20260116163515_cli_blank_create_reporting_procedures ║╟──────────┼──────────────────────────────────────────────────────╢║ migrated │ 20260116160315_cli_remove_table_resources ║╟──────────┼──────────────────────────────────────────────────────╢║ migrated │ 20260116155320_cli_remove_table_users ║╚══════════╧══════════════════════════════════════════════════════╝```
## Migration Files Location
Migrations are stored in `/app/migrator/migrations/` and follow the naming convention:[timestamp]_[description].cfc
Example:20240125160000_create_users_table.cfc
## Understanding Version Numbers
- Version numbers are timestamps in format: `YYYYMMDDHHmmss`- Higher numbers are newer migrations- Migrations run in chronological order
## Database Schema Table
Migration status is tracked in `c_o_r_e_migrator_versions` table:
```sqlSELECT * FROM c_o_r_e_migrator_versions;+----------------+| version |+----------------+| 20240101100000 || 20240105150000 || 20240110090000 || 20240115120000 |+----------------+Use Cases
Section titled “Use Cases”-
Check before deployment
Terminal window wheels dbmigrate info -
Verify after migration
Terminal window wheels dbmigrate latestwheels dbmigrate info -
Troubleshoot issues
- See which migrations have run
- Identify pending migrations
- Confirm database version
Troubleshooting
Section titled “Troubleshooting”Migration Not Showing
Section titled “Migration Not Showing”- Check file is in
/app/migrator/migrations/ - Verify
.cfcextension - Ensure proper timestamp format
Version Mismatch
Section titled “Version Mismatch”- Check
c_o_r_e_migrator_versionstable - Verify migration files haven’t been renamed
- Look for duplicate timestamps
Connection Issues
Section titled “Connection Issues”- Verify datasource configuration
- Check database credentials
- Ensure database server is running
Integration with CI/CD
Section titled “Integration with CI/CD”Use in deployment scripts:
#!/bin/bash# Check migration statuswheels dbmigrate info
# Run if neededif [[ $(wheels dbmigrate info | grep "pending") ]]; then echo "Running pending migrations..." wheels dbmigrate latestfiBest Practices
Section titled “Best Practices”- Always check info before running migrations
- Review pending migrations before deployment
- Keep migration files in version control
- Don’t modify completed migration files
- Use info to verify production deployments
See Also
Section titled “See Also”- wheels dbmigrate latest - Run all pending migrations
- wheels dbmigrate up - Run next migration
- wheels dbmigrate down - Rollback migration
- wheels dbmigrate create blank - Create new migration