retrospring/db/migrate/20220727174919_add_soft_deletes.rb
2022-07-28 21:01:59 +02:00

9 lines
269 B
Ruby

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