解决在 H2 数据库中不理解语句以进行单元测试的飞路迁移的最佳实践

Best practice to tackle flyway migrations where statements are not understood in H2 database for unit testing

我有一个 flyway 迁移文件,其中包含以下命令:

grant all privileges on schema public to ${admin_user} with grant option;`

现在我还想使用 H2 数据库对 sql 文件进行单元测试。但是即使打开 MODE=PostgreSQL 授权语句也是有问题的,因为它不被 H2 数据库理解。那么解决此类方言问题的最佳做法是什么?

根据常见问题解答,处理数据库特定 sql 的最佳策略是什么?:https://flywaydb.org/documentation/faq#db-specific-sql