Migrate
Published 15 January 2025
Description
Migrates the schema to the latest version. Flyway will create the schema history table automatically if it doesn't exist.
See Migrations for more information.
Usage examples
Migrate via command line
flyway migrate
Migrate via Maven
mvn flyway:migrate
Note that default phase is pre-integration-test
.
The new database version number is exposed in the flyway.current
Maven property.
Migrate via Gradle
gradle flywayMigrate
Parameters
Universal commandline parameters are listed here.
All relevant configuration settings are listed here. The settings from these sections can be set as parameters on the migrate
command:
- General settings
- Migration location and naming settings
- Migration reading settings
- Migration execution settings
- Flyway schema history settings
- Flyway Pipelines integration settings
- Baseline settings
- Placeholders
- Settings in database-specific namespaces
- Settings in secrets management namespaces
It is also possible to set environment settings as parameters.
All parameters are optional, although a target environment must be configured or passed in.
JSON output format
{
"initialSchemaVersion": null,
"targetSchemaVersion": "1",
"schemaName": "public",
"migrations": [
{
"category": "Versioned",
"version": "1",
"description": "first",
"type": "SQL",
"filepath": "C:\\flyway\\sql\\V1__first.sql",
"executionTime": 0
},
{
"category": "Repeatable",
"version": "",
"description": "repeatable",
"type": "SQL",
"filepath": "C:\\flyway\\sql\\R__repeatable.sql",
"executionTime": 0
}
],
"migrationsExecuted": 2,
"flywayVersion": "11.3.2",
"database": "testdb",
"warnings": [],
"operation": "migrate"
}