-- One-off migration: adds a discount_percent column to students, used to reduce
-- what a student is actually billed (billing:charge-students, ChargeStudents
-- command) and shown wherever a tariff price is displayed for that student
-- (students/show.blade.php: group card, add/edit-tariff preview, tariff dropdowns).
-- Restricted to {0, 5, 10, 15} at the form/validation level (a <select>, not
-- free text) — no DB-level CHECK constraint, matching this app's existing
-- fixed-value-set columns (e.g. lesson_substitutions.status), which use ENUM
-- instead of CHECK.
--
-- 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 students ADD COLUMN discount_percent TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER goal;
