Return to v2.1 docs


Migrator Migration Functions void migration

Migrates down: will be executed when migrating your schema backward Along with up(), these are the two main functions in any migration file Only available in a migration CFC

function down() {
	transaction {
		try {
			// your code goes here
		} catch (any e) {
			local.exception = e;

		if (StructKeyExists(local, "exception")) {
			transaction action="rollback";
			throw(errorCode="1", detail=local.exception.detail, message=local.exception.message, type="any");
		} else {
			transaction action="commit";

Related Functions

Migration Functions