weavejester / ragtime

Database-independent migration library
Eclipse Public License 1.0
610 stars 85 forks source link

Deletion of ragtime.jdbc/load-files breaks ragtime-clj #162

Open lread opened 1 week ago

lread commented 1 week ago

Hi @weavejester!

Cljdoc uses ragtime and ragtime-clj.

The ragtime-clj project makes use of ragtime.jdbc/load-files.

ragtime.jdbc/load-files was removed in ragtime 0.10.0 which causes ragtime-clj to fail with No such var: ragtime.jdbc/load-files.

Happy to help if I can. Maybe it's more appropriate to fix in ragtime-clj? Lemme know!

weavejester commented 1 week ago

Ah, apologies, I thought that wasn't being used by anyone else.

I think it's probably better to fix in ragtime-clj. The multimethod has been moved to ragtime.sql/load-file-seq, which allows the same method to support both ragtime.jdbc and ragtime.next-jdbc. Since this is a better design than having two identical multimethods doing the same thing, and since we haven't hit 1.0 yet, it's probably best to mark this as a breaking change and fix it in ragtime-clj.

I'll fix the CHANGELOG to make this clearer, too.

lread commented 1 week ago

Thanks for the reply! I've raised an issue at ragtime-clj.

lread commented 1 week ago

@weavejester, if the author of ragtime-clj is no longer active, would you consider addressing #131 to bring clojure migrations into ragtime itself?

weavejester commented 1 week ago

By Clojure migrations, you mean migrations that execute arbitrary functions?

lread commented 5 hours ago

Yep, here's an example cljdoc Clojure migration: https://github.com/cljdoc/cljdoc/blob/master/resources/migrations/010_convert_builds_error_info_from_exception_to_data.clj

Clojure migration should come with a caveat that they should be as self-contained as possible. You probably don't want migration relying on app code that might change, for example.