Code based database migration tools

Are there any database migration tools that support code based migrations similar to migratus in clojure.

In migratus, instead of sql files, users can specify a clojure namespace which must have two functions for up and down migrations. These functions will execute inside a transaction when the migration is run. They are useful if you need to make modifications to the data inside the tables in a migration. I need something like that in rust.

In a current Java project we use flyway.
There appears to be a Rust implementation, which I have not tested yet.
https://crates.io/crates/flyway