OnlineMigrations v0.5.2 Release Notes
Release Date: 2022-10-04 // almost 2 years ago-
🛠 Fix sequence resetting in tests that use fixtures
Fix
update_column_in_batches
for SQL subquery valuesIt generated inefficient queries before, e.g.:
update_column_in_batches(:users, :comments_count, Arel.sql(<<~SQL)) (select count(*) from comments where comments.user_id = users.id) SQL
Generated SQL queries before:
update users set comments_count = (..count subquery..) where comments_count is null or comments_count != (..count subquery..)
Generated SQL queries now:
update users set comments_count = (..count subquery..)
🛠 Fix check for
add_column
withdefault: nil
for PostgreSQL < 11Replacing a unique index when other unique index with the prefix of columns exists is safe
Previous changes from v0.5.1
-
- Raise for possible index corruption in all environments (previously, the check was made only in the production environment)