-- One-off migration: adds a flat-payment override to lessons, used when an
-- admin approves a teacher-substitution request "with fine"
-- (App\Http\Controllers\SubstitutionController::approve()). When set, this
-- value IS the lesson's total pay, overriding the normal
-- `lessons.payment * teachers.price_value` formula entirely — a flat amount
-- regardless of the covering teacher's own tariff or the existing
-- 0.5x/1x attendance-based multiplier on `payment`. NULL (the default) means
-- "no override", i.e. every existing lesson keeps being paid by tariff as
-- before.
--
-- MySQL doesn't support IF NOT EXISTS on ADD COLUMN — safe to run once; re-running
-- will error with "Duplicate column name", which is harmless.

ALTER TABLE lessons ADD COLUMN fixed_payment_amount DECIMAL(6,2) NULL AFTER payment;
