 							local.rv = local.rv & "#Chr(13)#-------- " & local.migration.cfcfile & " #RepeatString("-",Max(5,50-Len(local.migration.cfcfile)))##Chr(13)#";
 							request.$wheelsMigrationOutput = "";
 							request.$wheelsMigrationSQLFile = "#this.paths.sql#/#local.migration.cfcfile#_up.sql";
-							if (local.settings.writeMigratorSQLFiles) {
+							if (application[local.appKey].writeMigratorSQLFiles) {
 								FileWrite(request.$wheelsMigrationSQLFile, "");
 							}
 							local.migration.cfc.up();

		local.rv = local.rv & "#Chr(13)#------- " & local.migration.cfcfile & " #RepeatString("-", Max(5, 50-Len(local.migration.cfcfile)))##Chr(13)#";
		request.$wheelsMigrationOutput = "";
		request.$wheelsMigrationSQLFile = "#this.paths.sql#/#local.migration.cfcfile#_redo.sql";
		if (local.settings.writeMigratorSQLFiles) {
			FileWrite(request.$wheelsMigrationSQLFile, "");
		}
		if (local.settings.allowMigrationDown) {
			local.migration.cfc.down();
		}
		local.migration.cfc.up();

	return REReplaceNoCase(arguments.version, "[^0-9]", "" ,"all");
}

</cfscript>
