  * Inserts a record to flag a version as migrated.
  */
 private void function $setVersionAsMigrated(required string version) {
+	local.settings = $getMigratorSettingsScope();
 	$query(
-		datasource=application.wheels.dataSourceName,
-		sql="INSERT INTO #application.wheels.migratorTableName# (version) VALUES ('#$sanitiseVersion(arguments.version)#')"
+		datasource=local.settings.dataSourceName,
+		sql="INSERT INTO #local.settings.migratorTableName# (version) VALUES ('#$sanitiseVersion(arguments.version)#')"
 	);
 }
 

 * Deletes a record to flag a version as not migrated.
 */
private void function $removeVersionAsMigrated(required string version) {
	$query(
		datasource=application.wheels.dataSourceName,
		sql="DELETE FROM #application.wheels.migratorTableName# WHERE version = '#$sanitiseVersion(arguments.version)#'"
	);
}


							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) {
								FileWrite(request.$wheelsMigrationSQLFile, "");
							}
							local.migration.cfc.up();
