1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/db/migrate/20230119143245_add_deleted_at_to_event.rb
2023-01-20 08:53:37 +01:00

13 lines
566 B
Ruby

# frozen_string_literal: true
# Allow soft destroy of events.
# Events with existing reservation cannot be destroyed because we need them for rebuilding invoices, statistics, etc.
# This attribute allows to make a "soft destroy" of an Event, marking it as destroyed so it doesn't appear anymore in
# the interface (as if it was destroyed) but still lives in the database so we can use it to build data.
class AddDeletedAtToEvent < ActiveRecord::Migration[5.2]
def change
add_column :events, :deleted_at, :datetime
add_index :events, :deleted_at
end
end