- Added
skip_databases
option - Added experimental
remove_invalid_indexes
option - Added warning for unsupported adapters
- Improved output for
db:forward
,db:rollback
,db:migrate:up
, anddb:migrate:down
- Made operations more retriable with
safe_by_default
- Fixed migrations not running with Active Record 8 rc2
- Fixed issue with
alphabetize_schema
and virtual columns
- Improved install generator for Trilogy
- Fixed charset check for MariaDB 11.4
- Dropped support for Ruby < 3.1 and Active Record < 6.1
- Dropped support for Postgres < 12, MySQL < 8.0, and MariaDB < 10.5
- Added check for
add_column
with auto-incrementing columns - Updated instructions for removing a column to append to
ignored_columns
- Fixed check for adding a column with a default value for MySQL and MariaDB
- Added check for
add_unique_constraint
- Fixed false positives with
revert
- Added support for Trilogy
- Fixed foreign key options with
add_reference
andsafe_by_default
- Fixed
safety_assured
withrevert
- Fixed
safety_assured
for custom checks withsafe_by_default
- Added check for
change_column_default
- Added check for
add_column
with stored generated columns - Fixed
add_reference
withforeign_key
andindex: false
- Fixed
add_foreign_key
withname
andcolumn
options withsafe_by_default
- Fixed check for
change_column
to account for charset with MySQL and MariaDB
- Added
alphabetize_schema
option
- Added support for multiple databases to
target_version
- Added check for
add_exclusion_constraint
- Added support for
RACK_ENV
- Fixed error when
Rails
defined withoutRails.env
- Fixed error with
change_column_null
when table does not exist
- Improved error message for
add_column
withdefault: nil
with Postgres 10
- Fixed check for
add_column
withdefault: nil
with Postgres 10
- Added check for
add_column
withuuid
type and volatile default value
- Added check for index corruption with Postgres 14.0 to 14.3
- Added check for
force
option withcreate_join_table
- Improved errors for extra arguments
- Fixed ignoring extra arguments with
safe_by_default
- Fixed missing options with
remove_index
andsafe_by_default
New safe operations with MySQL and MariaDB
- Setting
NOT NULL
on an existing column with strict mode enabled
New safe operations with Postgres
- 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:limit
when not indexed - Changing a
cidr
column to aninet
column - Increasing
:precision
of aninterval
ortime
column
New unsafe operations with Postgres
- Adding a column with a callable default value
- Decreasing
:precision
of adatetime
column - Decreasing
:limit
of atimestamptz
column - Passing a default value to
change_column_null
Other
- Added experimental support for lock timeout retries
- Added
target_sql_mode
option - Added error for
change_column_null
with default value withsafe_by_default
option - Fixed instructions for
remove_columns
with options - Dropped support for Postgres < 10, MySQL < 5.7, and MariaDB < 10.2
- Fixed error with versioned schema with Active Record 7.0.2+
- Dropped support for Ruby < 2.6 and Active Record < 5.2
- Fixed error with multiple databases with Active Record 7
- Fixed issue with
add_reference ..., foreign_key: {to_table: ...}
withsafe_by_default
- Removed timeouts and
auto_analyze
from schema load
- Fixed
NOT NULL
constraint check for quoted columns - Fixed deprecation warning with Active Record 6.1
- Added checks for
add_check_constraint
andvalidate_check_constraint
- Added
safe_by_default
option to install generator - Fixed warnings with Active Record 6.1
- Added
safe_by_default
option
- Added support for float timeouts
- Added
target_version
option to replace database-specific options
- Added
check_down
option - Added check for
change_column
withnull: false
- Added check for
validate_foreign_key
- Improved error messages
- Made auto analyze less verbose in Postgres
- Decreasing the length limit of a
varchar
column or adding a limit is not safe in Postgres - Removed safety checks for
db
rake tasks (Rails 5+ handles this)
change_column_null
on a column with aNOT NULL
constraint is safe in Postgres 12+
- Improved comments in initializer
- Fixed string timeouts for Postgres
- Added warnings for missing and long lock timeouts
- Added install generator
- Fixed deprecation warnings with Ruby 2.7
- Added check for
add_reference
withforeign_key: true
- Increasing precision of
decimal
ornumeric
column is safe in Postgres 9.2+ - Making
decimal
ornumeric
column unconstrained is safe in Postgres 9.2+ - Changing between
timestamp
andtimestamptz
when session time zone is UTC in Postgres 12+ - Increasing the length of a
varchar
column from under 255 up to 255 in MySQL and MariaDB - Increasing the length of a
varchar
column over 255 in MySQL and MariaDB
- Fixed PostgreSQL version check
- Fixed timeouts for PostgreSQL
- Added
statement_timeout
andlock_timeout
- Adding a column with a non-null default value is safe in MySQL 8.0.12+ and MariaDB 10.3.2+
- Added
change_column_null
check for MySQL and MariaDB - Added
auto_analyze
for MySQL and MariaDB - Added
target_mysql_version
andtarget_mariadb_version
- Switched to
up
for backfilling
- Fixed migration name in error messages
- Added ability to disable checks
- Added Postgres-specific check for
change_column_null
- Added optional remove index check
- Allow
add_reference
with concurrent indexes
- Added
target_postgresql_version
- Added
unscoped
to backfill instructions
- Added check for
add_foreign_key
- Fixed instructions for adding default value with NOT NULL constraint
- Removed support for Rails 4.2
- Fixed error with
remove_column
andtype
argument - Improved message customization
- Added support for custom checks
- Adding a column with a non-null default value is safe in Postgres 11+
- Added checks for
add_belongs_to
,remove_belongs_to
,remove_columns
, andremove_reference
- Customized messages
- Added check for
change_column_null
- Added support for alphabetize columns with Makara
- Fixed migration reversibility with
auto_analyze
- Friendlier output
- Better method of hooking into Active Record
- Recommend
disable_ddl_transaction!
overcommit_db_transaction
- Suggest
jsonb
overjson
in Postgres 9.4+ - Changing
varchar
totext
is safe in Postgres 9.1+ - Do not check number of columns for unique indexes
- Added customizable error messages
- Updated instructions for adding a column with a default value
- Added
start_after
option
- Fixed error with
create_table
- Added check for executing arbitrary SQL
- Added check for
force
option withcreate_table
- Added
auto_analyze
option
- Adding an index to a newly created table is now safe
- Fixed error with Ruby 2.3 frozen strings
- Added alphabetize columns
- Disabled dangerous rake tasks in production
- Added ability to use
SAFETY_ASSURED
env var
- Skip checks on down migrations and rollbacks
- Added check for indexes with more than 3 columns
- Fixed
add_index
check for MySQL
- First release