What problem does it solve?
This Skill automates the creation of database-agnostic migrations for CFWheels, preventing the use of database-specific SQL and ensuring cross-database compatibility for all your schema changes. It includes critical fixes for common CLI-generated bugs, saving you from silent failures.
Core Features & Use Cases
- Schema Management: Generates migrations for creating/altering tables, adding/removing columns, indexes, and foreign keys.
- Database-Agnostic Code: Emphasizes using CFML date functions and proper formatting to avoid vendor-specific SQL.
- Critical Bug Fixes: Includes mandatory post-CLI-generation fixes for string boolean parameters and guidance on composite index ordering.
- Use Case: Need to add a
posts table with title, content, and userId columns, plus indexes and a foreign key to users? This skill generates the migration, ensuring it's compatible across different databases and includes crucial fixes to prevent common pitfalls.
Quick Start
Create a new migration file:
wheels g migration CreatePostsTable
Example migration content:
component extends="wheels.migrator.Migration" {
function up() {
t = createTable(name="posts");
t.string(columnNames="title");
t.create();
}
function down() {
dropTable("posts");
}
}