OnlineMigrations v0.4.0 Release Notes
Release Date: 2022-03-17 // about 2 years ago-
Lazy load this gem
โ Add ability to reset counter caches using background migrations
class User < ApplicationRecord has_many :projects end class Project < ApplicationRecord belongs_to :user, counter_cache: true end class ResetUsersProjectsCount < ActiveRecord::Migration[7.0] def up reset_counters_in_background("User", :projects) end end
Accept
0
asbatch_pause
value for background migrations0๏ธโฃ Ignore default scopes in
CopyColumn
andBackfillColumn
background migrations๐ Raise an error for unsupported database versions
๐ Fix backfilling code in suggestion for changing column's NOT NULL
๐ New safe operations
- Changing between
text
andcitext
when not indexed - Changing a
string
column to acitext
column when not indexed - Changing a
citext
column to astring
column with no length limit - Increasing the
:precision
of aninterval
column - Changing a
cidr
column to aninet
column - Changing an
xml
column to atext
column - Changing an
xml
column to astring
column with no:limit
- Changing a
bit
column to abit_varying
column - Increasing or removing the
:limit
of abit_varying
column
๐ New unsafe operations
- Decreasing
:precision
of adatetime
column - Decreasing
:limit
of atimestamptz
column - Decreasing
:limit
of abit_varying
column - โ Adding a
:limit
to abit_varying
column