如何控制flyway可重复脚本的执行顺序

How to control execution order of flyway repeatable scripts

有没有办法控制flyway中可重复迁移脚本的执行顺序? 我想 运行 在校验和更改的所有其他可重复或版本化脚本之后的可重复迁移脚本。

可重复脚本似乎由 R__suffixfirst numericalpha upper casealpha lower case、[=17 之后的名称控制=]

Instead of being run just once, they are (re-)applied every time their checksum changes.

Within a single migration run, repeatable migrations are always applied last, after all pending versioned migrations have been executed.

https://flywaydb.org/documentation/migrations#repeatable-migrations

也许以正确的顺序命名脚本是不够的。如果你把它们命名为R__AR__BR__C,它第一次起作用,但是当你以后只改变R__B时,那么只有R__B执行。这可能是一个问题,如果后续脚本应该重新执行但没有改变。例如,R__B 创建一个 table 并且 R__C 插入一些静态数据。