Supporting `DEFERRABLE` and `INITIALLY DEFERRED` in migrations

94 views
Skip to first unread message

Zach Daniel

unread,
Jun 9, 2022, 2:39:20 PM6/9/22
to elixir-ecto
This would be really useful to have in the migration syntax, to avoid needing to hand-write sql. Especially because in postgres there is no `ALTER CONSTRAINT` statement meaning that you have to write the entire constraint creation in raw SQL. Deferrable constraints can greatly simplify the code around working with certain kinds of tree structures and/or bidirectional references, that kind of thing. My current use case for them is to avoid having to figure out the proper order to insert changes made to a tree structure, for both performance and code clarity.

Happy to take a look at doing this, but want to check interest/feasibility/concerns first.
Reply all
Reply to author
Forward
0 new messages