Using Flyway with mySQL then migrated to postgreSQL. flyway_schema_history success datatype issue
DougGuzek_1
Posts: 1 New member
We have an application that was using mySQL as the Db. Flyway was utilized as well during that time.
The application, prior to my arrival on the team, had changed to postgreSQL.
A db migration tool, separate from flyway, was used to migrate actual data and the creation of the postgreSQL tables.
that was done all is working with app. There is no issue there.
However, we now have new flyway script in the app. We created it, for the next version and want to create a new table in the app now using postgreSQL.
Flyway did not execute the new script. We see that it complaining that the flyway_schema_history success column datatype is not as expected. Its data type is still smallInt and not boolean. I think it actually WAS tinyInt when under mySQL but that SEPARATE migration tool changed it to smallInt.
However, I do see documentation or discussions where mySql has that column as "int" while postgreSQL use in flyway is boolean.
NOTE: this flyway_schema_history table, right or wrong, is in our schema of all our applications Tables.
We simply, ran an SQL script to drop that column, create the column as boolean. Then ensured all were true and false based on how it was 1, 0 prior as Int.
We then deployed and our new flyway script (and additionals) ran perfectly fine.
Seems simple, under this situatino.
However, looking for advise or feedback here. Is there ANYTHING else we need to do?
Remember, we are PAST how it SHOULD have been done, we cant go back to that moment.
The application, prior to my arrival on the team, had changed to postgreSQL.
A db migration tool, separate from flyway, was used to migrate actual data and the creation of the postgreSQL tables.
that was done all is working with app. There is no issue there.
However, we now have new flyway script in the app. We created it, for the next version and want to create a new table in the app now using postgreSQL.
Flyway did not execute the new script. We see that it complaining that the flyway_schema_history success column datatype is not as expected. Its data type is still smallInt and not boolean. I think it actually WAS tinyInt when under mySQL but that SEPARATE migration tool changed it to smallInt.
However, I do see documentation or discussions where mySql has that column as "int" while postgreSQL use in flyway is boolean.
NOTE: this flyway_schema_history table, right or wrong, is in our schema of all our applications Tables.
We simply, ran an SQL script to drop that column, create the column as boolean. Then ensured all were true and false based on how it was 1, 0 prior as Int.
We then deployed and our new flyway script (and additionals) ran perfectly fine.
Seems simple, under this situatino.
However, looking for advise or feedback here. Is there ANYTHING else we need to do?
Remember, we are PAST how it SHOULD have been done, we cant go back to that moment.
Tagged:
Answers
What you've done sounds sufficient.
My 'what you should do' could still be performed as it's just rebuilding the table.