;;in example.migration (defn clean-db [& [force?]] (if-not force? (throw (Throwable. "This is a destructive action! Pass in `force' to make this go through")) (let [datasource (get-db-datasource) flyway (doto (Flyway.) (.setDataSource datasource) (.setSqlMigrationPrefix ""))] (.clean flyway)))) ;; and a nice alias in the project.clj :aliases {"migrate" ["run" "-m" "example.migration/migrate"] "clean" ["run" "-m" "example.migration/clean-db"]})