Skip to content

Instantly share code, notes, and snippets.

@hugoheden
Last active November 24, 2021 17:32
Show Gist options
  • Save hugoheden/a0a7bdb83f92cc75781bfd56d5bb90e3 to your computer and use it in GitHub Desktop.
Save hugoheden/a0a7bdb83f92cc75781bfd56d5bb90e3 to your computer and use it in GitHub Desktop.
One off Flyway command line examples
# Flyway command line examples
#
# Print some info about the migrations applied (or not) in the DB, relating to the migration scripts in some directory
flyway -X -url='jdbc:mariadb://localhost:3306/my_db?currentSchema=my_schema' \
-user='my_db_user' -password='my_db_passwd' \
-locations=filesystem:./src/main/resources/db/migration \
info
# Migrate the DB using the files in the directory, but only up to version 1.2
flyway -X -url='jdbc:mariadb://localhost:3306/my_db?currentSchema=my_schema' \
-user='my_db_user' -password='my_db_passwd' \
-locations=filesystem:./src/main/resources/db/migration \
-target='1.2' migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment