-- ============================================================
-- Migracja: dodanie kolumny employment_type do franchisee_employee
-- Data: 2026-04-20
-- Kontekst: api / franchisee_employee
-- ============================================================

ALTER TABLE franchisee_employee
    ADD COLUMN employment_type ENUM(
        'employment_contract',
        'civil_law_contract',
        'b2b',
        'temporary_work',
        'internship',
        'volunteer',
        'other'
    ) NOT NULL DEFAULT 'employment_contract'
    AFTER franchise_role;

-- Ustaw wartość domyślną dla istniejących rekordów (redundantne przy DEFAULT, ale dla pewności):
UPDATE franchisee_employee
SET employment_type = 'employment_contract'
WHERE employment_type IS NULL
   OR employment_type = '';

