Recognising changes from flyway scirpts in subsequent scripts?
Answered
Hi all,
I am using flyway. In one script, I alter table A and add column z.
In the next, I insert values into A, but IntelliJ is highlighting z in red - because the column doesn't exist on the server yet.
Is there a way for it to take the previous script into account (and not highlight the column)? (Much like Playground vs Script resolve modes within a single file/console?)
Cheers,
Christian
Please sign in to leave a comment.
Hi Christian,
It is supposed to work like that by default, see example for MySQL:
What JDBC driver do you use in the IDE to connect to your database?
Sorry, by scripts, I actually meant different files... So, with your example, the Add Column would be in file 1.sql, and the inserts in file 2.sql
Extrapolative highlighting like this only works in the context of a single editor tab I'm afraid.
As a workaround, you can enable Tx:Manual mode in script1 and execute the ALTER TABLE statement without committing it, then switch over to script2 where syntax errors will have disappeared. After you are done with making changes to script2, you can roll back the transaction in script1 if you don't need the change to be applied right away.
That's a neat little trick, thanks! :)