retrospring/db/migrate/20220727174919_add_soft_deletes.rb

10 lines
269 B
Ruby
Raw Permalink Normal View History

2022-07-28 21:00:12 +02:00
class AddSoftDeletes < ActiveRecord::Migration[6.1]
def change
%i[answers appendables comments questions users].each do |table|
say "Migrating #{table}"
add_column table, :discarded_at, :datetime
add_index table, :discarded_at
end
end
end