metabase / toucan

A classy high-level Clojure library for defining application models and retrieving them from a DB
Eclipse Public License 1.0
570 stars 49 forks source link

Migrations? #94

Closed himat closed 1 year ago

himat commented 2 years ago

Hi,

How do you recommend doing migrations with toucan? Are we supposed to use a separate library for that?

@camsaul

bolivier commented 2 years ago

@himat I'm not a contributor, but I don't think this lib is scoped for migrations.

migratus is a library to handle migrations that works very well.

geraldodev commented 1 year ago

If I may https://gist.github.com/geraldodev/f4cc25376331ebd37d2eb8a4d3ccf8a9 mybatis migrations are sql based. This simple babashka script is meant to be placed on the root of the project, it will default the migrations to WhereUPutTheScript/migrations. it builds the classpath to invoke migrations, it downloads the dependencies (bb has a deps.edn like library) ./migrate.clj init ./migrate.clj status ./migrate.clj up ./migrate.clj down

tsmacdonald commented 1 year ago

I don't think this lib is scoped for migrations.

This is correct; toucan doesn't do anything for migrations. Metabase uses Liquibase, but Migratus or MyBatis (as suggested) or whatever should all work too.

camsaul commented 1 year ago

Yup, I want to second https://github.com/yogthos/migratus -- I haven't used it personally yet but if I were to start a new project I think I'd give that a go