Fork me on GitHub
#honeysql
<
2022-05-02
>
andersmurphy13:05:33

Just published a blog post on adding support for alter column and add constraint . Seems like postgresql doesn’t support modify column unless I’m missing something. Anyway, just wanted to check I wasn’t missing any obvious existing support for these to clauses. Cheers. https://andersmurphy.com/2022/05/02/clojure-extend-honeysql-to-support-postgres-alter-column-and-add-constraint.html

andersmurphy13:05:48

I appreciate these clauses are only uses when when writing migrations (so not that common), but we write our migrations in honeysql. 😃

seancorfield15:05:13

Ah, it seems modify column is actually MySQL only and alter column is the ANSI/other version. I'll create a GH issue and fix that.

🙏 1
andersmurphy17:05:20

@seancorfield Thanks! That makes sense. I assumed it was postgres being different to ANSI. But you are right it’s MySQL that’s different in this case. I’ll update the blog post to reference the ticket (not that I get much traffic it’s mainly personal reference material for when I forget how to do things). Thanks for sharing the issue. I’ve been diving into the internals of honeysql so I’m curious to see what this sort of change would involve. One thing I did notice is that modify column supports changing constraints where as alter column does not, you need to use drop constraint / add constraint as far as I can tell.

seancorfield17:05:57

There's a ticket for standalone add index I believe but not yet constraint and not within the ... column stuff. DDL is a bit of a "wild west" so adding support for it is a giant PITA quite often.

seancorfield17:05:20

Please create GH issues as needed around DDL support!

👍 1