Electron100 / butane

An ORM for Rust with a focus on simplicity and on writing Rust, not SQL
Apache License 2.0
83 stars 11 forks source link

Add references when adding/changing pg columns #239

Closed jayvdb closed 2 months ago

jayvdb commented 2 months ago

I forgot this when doing https://github.com/Electron100/butane/pull/158

It works well when a migration is only doing one column add/change.. For larger inter-related migrations, the user will need to re-arrange the DDL to make pg happy. But at least with this PR they wont forget, and have the required DDL, albeit in the wrong order.

A lot of work is going to be needed to choice the best order of operations in order to correctly migrate and rollback, esp if there is data, i.e. https://github.com/Electron100/butane/issues/226