I would like to get the latest schema version value of a particular database using Flyway. Is there a function in Flyway to get the current schema version number in command line?
I can run the following command:
flyway info
This gives me the entire schema content for my database (shortened) as follows:
+----------------+-------------------------------------+---------------------+---------+
| Version | Description | Installed on | State |
+----------------+-------------------------------------+---------------------+---------+
| 1.0.1 | Create Table TRACKPATH | 2015-11-10 08:39:36 | Success |
| 1.0.2 | Create Table TRACKGAUGE | 2015-11-10 08:39:36 | Success |
| ... | ... | ... | ... |
| 1.5.7 | Create Table FUNCTIONAL SITE | 2015-11-10 08:40:10 | Success |
| 1.5.8 | Create Table TOPOGRAPHY AREA | 2015-11-10 08:40:10 | Success |
| 1.5.9 | Create Table FS DETAILDEFD | 2015-11-10 08:40:11 | Success |
+----------------+-------------------------------------+---------------------+---------+
I am only interested in the last schema entry version '1.5.9' value.
My environment is as follows:
- Windows 7
- Flyway 3.0