migrate up --pretend is supposed to print the SQL that would run without executing it. When a migration uses queryExecute() directly, the DDL is silently committed to the database (only the write to the cfmigrations table is skipped).
Migrations using the schema/qb builder are not affected.
Steps to reproduce
- Create a migration that uses
queryExecute() in up()
- Run
migrate up --pretend
- No SQL is printed, but the table is created in the database
- Run again - fails with
Table 'X' already exists
// Affected - DDL executes despite --pretend
function up( schema, qb ){
queryExecute("CREATE TABLE users ( ... )");
}
// Not affected - schema builder correctly handles pretend mode
function up( schema, qb ){
schema.create("users", function(table){
table.increments("id");
});
}
Environment
- commandbox-migrations: 5.3.0
- db: MySQL
migrate up --pretendis supposed to print the SQL that would run without executing it. When a migration usesqueryExecute()directly, the DDL is silently committed to the database (only the write to thecfmigrationstable is skipped).Migrations using the
schema/qbbuilder are not affected.Steps to reproduce
queryExecute()inup()migrate up --pretendTable 'X' already existsEnvironment