From a8c0ebccbdbf4e2ccbacbf94cba6cf24699af190 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 5 Mar 2019 00:57:38 +0200 Subject: Allow `truncate` for SQLite3 adapter and add `rails db:seed:replant` (#34779) * Add `ActiveRecord::Base.connection.truncate` for SQLite3 adapter. SQLite doesn't support `TRUNCATE TABLE`, but SQLite3 adapter can support `ActiveRecord::Base.connection.truncate` by using `DELETE FROM`. `DELETE` without `WHERE` uses "The Truncate Optimization", see https://www.sqlite.org/lang_delete.html. * Add `rails db:seed:replant` that truncates database tables and loads the seeds Closes #34765 --- activerecord/CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/CHANGELOG.md') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 979b48c654..04449a3ebc 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,12 @@ +* Add `rails db:seed:replant` that truncates tables of each database + for current environment and loads the seeds. + + *bogdanvlviv*, *DHH* + +* Add `ActiveRecord::Base.connection.truncate` for SQLite3 adapter. + + *bogdanvlviv* + * Deprecate mismatched collation comparison for uniqueness validator. Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. -- cgit v1.2.3