1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(doc) fix comment in migration

This commit is contained in:
Sylvain 2022-03-21 12:50:03 +01:00
parent 6addc8f4c2
commit dc8c36029b

View File

@ -1,8 +1,7 @@
# frozen_string_literal: true
# This migration removes the NotNull constraint on the foreign key of closed_by
# column on the accounting_periods table. This is needed because it prevented
# to delete an admin who closed an accounting period.
# This migration allows to update the closed_by column on the accounting_periods table.
# This is needed because the previous rule prevented to delete an admin who closed an accounting period.
class AllowUpdateClosedByOnAccountingPeriods < ActiveRecord::Migration[5.2]
def up
execute <<~SQL
@ -11,7 +10,7 @@ class AllowUpdateClosedByOnAccountingPeriods < ActiveRecord::Migration[5.2]
WHERE (
new.start_at <> old.start_at OR
new.end_at <> old.end_at OR
new.closed_at <> old.closed_at OR
new.closed_at <> old.closed_at OR
new.period_total <> old.period_total OR
new.perpetual_total <> old.perpetual_total)
DO INSTEAD NOTHING;