Created
July 20, 2017 06:52
-
-
Save zdtsw/0a960a65cd5affce4bf61bfeb6720a51 to your computer and use it in GitHub Desktop.
How to work with flyway in a nutshell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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