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

[pg] Use ALTER TABLE instead of copies #243

Closed Electron100 closed 2 months ago

Electron100 commented 2 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 2 months ago

TODO: needs unit tests