retrospring/db/migrate/20220727174919_add_soft_deletes.rb
2022-07-27 21:17:55 +02:00

9 lines
265 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, :deleted_at, :datetime
add_index table, :deleted_at
end
end
end