Skip to content

Instantly share code, notes, and snippets.

@zdtsw
Created July 20, 2017 06:52
Show Gist options
  • Select an option

  • Save zdtsw/0a960a65cd5affce4bf61bfeb6720a51 to your computer and use it in GitHub Desktop.

Select an option

Save zdtsw/0a960a65cd5affce4bf61bfeb6720a51 to your computer and use it in GitHub Desktop.
How to work with flyway in a nutshell
1. install flyway command line by downloading: flyway-commandline-4.2.0-linux-x64.tar.gz (or some later version)
2. >tar xvfz flyway-commandline-4.2.0-linux-x64.tar.gz
3. >cd flyway-4.2.0
4. >vi conf/flyway.conf
: user, pasword, url need to be updated with correct value
5. >vi sql/V1__Create_person_table.sql
: put how you want to perform on the first transition, say create table etc
6. >flyway validate to check it first
7. >flyway migrate
: if you see ERROR, try to fix it in the *.sql file you created above
8. to check if it is done >flyway info
:if you see success then it is good to go
:if you see pending, run >flyway migrate , then do the check again
:if you see failed, maybe some manual cleanup for the db is required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment