Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does flyway decide order of execution for sql scripts

Tags:

flyway

How does flyway decide order of execution for sql scripts.

I have attached a screenshot of scripts I have in my project in various directories; but it executed it in different order than I expected. Also, the execution order varies if I ran the scripts in incremental manner or all at the same time.

Here's the order I expected them to execute in.

enter image description here

Here's the order they got executed in.

enter image description here

I am using flyway-core 4.0.3 with sprint boot. I have set flyway.out-of-order=true.

like image 256
Varun Avatar asked Dec 10 '25 05:12

Varun


1 Answers

Flyway ignores leading zeroes between dots and that's why the order was different than what I expected. Once I removed leading zeroes; the scripts were executed in order I expected.

like image 75
Varun Avatar answered Dec 13 '25 04:12

Varun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!