Migration Info Table Not Displayed From API Using flyway.info()
Preston
Posts: 5 Bronze 1
I'm new to Flyway and am using Community, v9.22.3
I've successfully used the baseline() and migrate() Java API, but when I use the API to show the migration information I'm only getting the following:
Database: jdbc:mysql://127.0.0.1:3306/mydb_test (MySQL 8.0)
But when I get info from the command line I get this:
WARNING: A Flyway License was not provided; fell back to Community Edition. Please contact sales at sales@flywaydb.org for license information.
Database: jdbc:mysql://127.0.0.1:3306/mydb_test (MySQL 8.0)
Schema version: 2023.10.30.09.48
+-----------+------------------+-----------------------+----------+---------------------+----------+----------+
| Category | Version | Description | Type | Installed On | State | Undoable |
+-----------+------------------+-----------------------+----------+---------------------+----------+----------+
| | 2019.02.11.00.00 | << Flyway Baseline >> | BASELINE | 2023-10-30 10:42:22 | Baseline | No |
| Versioned | 2023.10.30.09.44 | JF3.0 employees | SQL | 2023-10-30 10:54:26 | Future | No |
| Versioned | 2023.10.30.09.48 | JF3.0 tasks | SQL | 2023-10-30 10:54:26 | Future | No |
+-----------+------------------+-----------------------+----------+---------------------+----------+----------+
WARNING: Unable to create default report files.
How do I go about getting the table displayed when running info() via the API?
Thanks,
Preston
Tagged:
Best Answer
-
Peter_Laws Posts: 278 Silver 2Hello Preston, welcome to flyway!
Yes the API handles it differently as the table would give you extraneous characters that you'd have to work around since you're presumably going to act upon the returned data.
The MigrationInfoService method exposes the results you're looking for
https://javadoc.io/doc/org.flywaydb/flyway-core/latest/org/flywaydb/core/api/MigrationInfoService.html
If you're not seeing any results, you're most likely missing a filter.
Answers