in my Company we manage a SaaS infrastructure that uses PostgreSQL as DB solution. However, some clients wants us to perform an on-premise deployment, in which they provide MySQL instead.
This of course entails identifying and isolate PG-specific datatypes and functions, find a corresponding MySQL equivalent, and make them run properly.
If we were using Liquibase, that would be easy, since it would require me to write databaseChangeLog(s) with a precondition like this:
<preConditions onFail="HALT">
<dbms type="mysql"/>
</preConditions>
and include as many as I want within the same databaseChangeLog
With Flyway however, it seems like the only possible way is to define different folders, under which place the SQL files for a particular RDBMS.
This seems quite overkill and error-prone to me, so I would like to know: does Flyway have some specific syntax that I missed, which allows me to write different SQL-dialect-specific queries within the same .sql file? I.E. I would hypothetically expect something like this :
--; if(mysql)
CREATE TABLE test (start_date TIMESTAMP NOT NULL);
--; endif
--; if(postgresql)
CREATE TABLE test (start_date TIMESTAMPTZ NOT NULL);
--; endif
...
thank you in advance!