rails
rails copied to clipboard
Optimize add_timestamps to use a single SQL statement when supported
Summary
Both MySQL and PostgreSQL support dropping multiple columns in a single SQL statement.
SQLite3 does not support this feature so its adapter overrides the add_timestamps
method to workaround SQLite3's ALTER TABLE
limitations.
The add_timestamps_for_alter
method creates the ALTER TABLE SQL fragments to execute.
Same approach as https://github.com/rails/rails/pull/42075