mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
20 lines
597 B
Ruby
20 lines
597 B
Ruby
# frozen_string_literal: true
|
|
|
|
# add is_valid to slots_reservations
|
|
# remove validated_at from slots_reservations
|
|
class AddIsValidToSlotsReservations < ActiveRecord::Migration[7.0]
|
|
def up
|
|
add_column :slots_reservations, :is_valid, :boolean
|
|
SlotsReservation.reset_column_information
|
|
SlotsReservation.all.each do |sr|
|
|
sr.update_column(:is_valid, true) if sr.validated_at.present?
|
|
end
|
|
remove_column :slots_reservations, :validated_at
|
|
end
|
|
|
|
def down
|
|
remove_column :slots_reservations, :is_valid
|
|
add_column :slots_reservations, :validated_at, :datetime
|
|
end
|
|
end
|