Almost all Ruby on Rails developers might come across scenario where they need to add a new column with a default value to one of the database tables. Most of us (including me) would write following migration statement -
add_column :table_name, :column_name, :boolean, default: false
This is a good practice but would cause downtime if the table has large number of records. It took
3 secs when I ran the migration for a table having 50k records.
-- add_column(:table_name, :column_name,...