juxt / joplin

Flexible datastore migration and seeding for Clojure projects
Eclipse Public License 1.0
316 stars 48 forks source link

Any interest in a code-driven JDBC migrator? #7

Closed michaelklishin closed 10 years ago

michaelklishin commented 10 years ago

Using plain SQL is very convenient for defining the schema but production migrations can involve modifying data in less-than-trivial ways.

Do you have any thoughts on having a separate JDBC-powered migrator that uses Clojure code instead of .sql files, à la Cassandra?

And a related question: any interest in a file-driven CQL migrator?

martintrojer commented 10 years ago

Yes,

the difference between SQL and non-SQL migrations is a bit ugly. Personally I prefer the 'code-driven' / 'drift-style' migrators. They are a bit more verbose but gives you maximum flexibility.

The reason for keeping the ragtime SQL migrators was for computability reasons. But I agree that it would be nice allow code-drive SQL migrators, it would make joplin more symmetric :)

Generally I don't want to go in the non-code S/C-QL direction.

danielytics commented 10 years ago

For SQL, I personally like Yesql, which makes me perfectly comfortable with going code-driven all the way (since I'd put the SQL in separate files anyway). But that's just me and obviously others have different library preferences, so this may not make much sense for them.

martintrojer commented 10 years ago

I've started work on this task... See this branch, https://github.com/martintrojer/joplin/tree/code-driven-jdbc

I'm thinking to introduce a breaking change; the 'jdbc' type will now be the code-driven migrator and 'sql' will be the ragtime-sql one.

michaelklishin commented 10 years ago

@martintrojer wanted to suggest doing the same. Yay!

martintrojer commented 10 years ago

Finally got around to do this. Change is breaking as described above.