documentation/Reference/Configuration/Flyway Namespace/Flyway Target Setting.md
The target version up to which Flyway should consider migrations. This must be a valid migration version, or one of the special values detailed later.
When migrating forwards, Flyway will apply all migrations up to and including the target version. Migrations with a
higher version number will be ignored. If the target is current, then no versioned migrations will be
applied but repeatable migrations will be, together with any callbacks.
current: designates the current version of the schemalatest: the latest version of the schema, as defined by the migration with the highest versionnext: the next version of the schema, as defined by the first pending migration<version>?: instructs Flyway to not fail if the target version doesn't exist. In this case, Flyway will go up to but not beyond the specified target (default: fail if the target version doesn't exist) (e.g.) target=2.1?When undoing migrations, Flyway works its way up the schema history table (i.e. in reverse applied order), undoing versioned migrations until it gets to one meeting one of these conditions:
Specifying a target version should be done with care, as undo scripts typically destroy database objects.
current, latest, next: designates the current version of the schema. Flyway will undo the latest applied migration.<version>?: instructs Flyway to not fail if the target version doesn't exist. In this case, Flyway will go down to but not beyond the specified target (default: fail if the target version doesn't exist) (e.g.) target=2.1?String
"latest" for versioned migrations
"current" for undo migrations.
This can't be set in a config file via Flyway Desktop, although it will be honoured, and it can be configured as an advanced parameter in operations on the Migrations page.
./flyway -target="2.0" migrate
[flyway]
target = "2.0"
flyway.target=2.0
FLYWAY_TARGET=2.0
Flyway.configure()
.target("2.0")
.load()
flyway {
target = '2.0'
}
<configuration>
<target>2.0</target>
</configuration>