This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-10
Channels
- # announcements (14)
- # bangalore-clj (1)
- # beginners (89)
- # calva (166)
- # cider (33)
- # clara (12)
- # clj-kondo (1)
- # cljdoc (8)
- # clojure (101)
- # clojure-austin (1)
- # clojure-colombia (7)
- # clojure-dev (14)
- # clojure-europe (5)
- # clojure-hamburg (10)
- # clojure-italy (9)
- # clojure-nl (31)
- # clojure-spec (4)
- # clojure-uk (39)
- # clojurescript (17)
- # clojutre (3)
- # code-reviews (16)
- # cursive (72)
- # data-science (1)
- # datomic (81)
- # duct (8)
- # emacs (4)
- # figwheel-main (1)
- # graalvm (2)
- # jobs (9)
- # kaocha (21)
- # lambdaisland (2)
- # luminus (4)
- # off-topic (35)
- # re-frame (1)
- # reagent (101)
- # reitit (4)
- # ring-swagger (5)
- # shadow-cljs (17)
- # sql (40)
- # tools-deps (4)
- # vim (28)
We rolled our own at work (because we got started with it before we adopted Clojure -- and then we rolled our own Clojure version of our legacy migration system 🙂 ).
But I think Migratus is fairly popular.
There's also Ragtime
I think if we were starting from scratch, we might go with Migratus because it addresses the linear ordering problem that Ragtime has.
Hi @seancorfield you know your examples of using plan, i.e.,
ahhh, I had the select-keys, but in d'oh moment forgot the '#' to indicate inline anonymous function!
ok curious how people are using migratus without leiningen - are you making clj aliases with a separate main? should I just get over only wanting to use tools.deps? 😉 are you just REPL-ing into prod? 😉
we let the app run the migrations every time the app starts. This way code/db are always synced. We have bash scripts to help us create new migration files. We use tools.deps
I use integrant to "inject" the migration function which kickstarts the migration of the db.
We run our "migration task" as a deliberate deployment action. We can include it as part of a full build deployment or we can run it on its own. We use CLI/`deps.edn` for everything -- we switched from lein
to boot
in 2015 and to the new tools last year. And, yes, we have REPLs in (some) production processes and we do occasionally apply code patches live that way (mostly the REPL, for us, is used for diagnostics/investigation).
We have over half a dozen separate apps on half a dozen servers that run against our primary DB so running migrations as part of app startup would not make sense for us.
we have separated databases for all the services that we use. less headache 🙂. but we only did it because it made sense for us and our use cases actually allow it.
as for migrations on every (test/dev) run - dont forget to rebase every now and then ... replaying 4 or 14 years of migrations step by step is going to cost you a lot of time 🙂
if you do well enough you will do them somewhat manually again 😄
db migrations get tender when your databases grow into terabytes
and most tooling is illsuited
any successfull use of next.jdbc with oracle ? I'm not getting the namespaced keywords
@geraldodev I don't have an Oracle install to test against. If you're not getting namespaced keywords back from Oracle in next.jdbc
with a default set of options (i.e., no :builder-fn
) then it would seem that calling .getTableName
returns an empty string (or null) on Oracle -- and there's not much I can do about that.
next.jdbc
simply calls https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html#getTableName-int- on the ResultSetMetaData
@seancorfield thank you for the info
Oracle continues to be a thorn in everyone's side I think 🙂 I can only do what the JDBC driver allows.
I've even downloaded an updated one to see if it would fix the problem
I've also used next.jdbc with hugsql and its adapter https://gitlab.com/nikperic/hugsql-next-jdbc/blob/master/src/hugsql/adapter/next_jdbc.clj#L17 This call has a little conflict with next.jdbc instrumentated. the instrumentation expects a map and it's sometimes passing a nil. Thank you for the effort of rewriting jdbc. Very appreciated work. I want to learn datafy and nav and I am eager to try with next.jdbc.