Electron100 / butane

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

[pg] Use ALTER TABLE instead of copies #243

Closed Electron100 closed 7 months ago

Electron100 commented 7 months ago

For the Postgres backend, use the appropriate ALTER TABLE command for changed columns instead of copying and recreating the table.

This makes the generated sql more readable and also makes it easier to be correct with foreign key constraints, since the recreated table does not automatically replace the old one in constraints.

Electron100 commented 7 months ago

TODO: needs unit tests