-- Generated by scripts/sync_enums.py — review before applying

DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_contrat_type'
          AND e.enumlabel = 'brouillon'
    ) THEN
        ALTER TYPE statut_contrat_type ADD VALUE 'brouillon';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_dossier_type'
          AND e.enumlabel = 'envoye'
    ) THEN
        ALTER TYPE statut_dossier_type ADD VALUE 'envoye';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_enfant_type'
          AND e.enumlabel = 'actif'
    ) THEN
        ALTER TYPE statut_enfant_type ADD VALUE 'actif';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_enfant_type'
          AND e.enumlabel = 'scolarise'
    ) THEN
        ALTER TYPE statut_enfant_type ADD VALUE 'scolarise';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'genre_type'
          AND e.enumlabel = 'F'
    ) THEN
        ALTER TYPE genre_type ADD VALUE 'F';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'genre_type'
          AND e.enumlabel = 'H'
    ) THEN
        ALTER TYPE genre_type ADD VALUE 'H';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'type_evenement_type'
          AND e.enumlabel = 'absence_enfant'
    ) THEN
        ALTER TYPE type_evenement_type ADD VALUE 'absence_enfant';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_evenement_type'
          AND e.enumlabel = 'propose'
    ) THEN
        ALTER TYPE statut_evenement_type ADD VALUE 'propose';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'role_type'
          AND e.enumlabel = 'administrateur'
    ) THEN
        ALTER TYPE role_type ADD VALUE 'administrateur';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'role_type'
          AND e.enumlabel = 'assistante_maternelle'
    ) THEN
        ALTER TYPE role_type ADD VALUE 'assistante_maternelle';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'role_type'
          AND e.enumlabel = 'gestionnaire'
    ) THEN
        ALTER TYPE role_type ADD VALUE 'gestionnaire';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'role_type'
          AND e.enumlabel = 'parent'
    ) THEN
        ALTER TYPE role_type ADD VALUE 'parent';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_utilisateur_type'
          AND e.enumlabel = 'actif'
    ) THEN
        ALTER TYPE statut_utilisateur_type ADD VALUE 'actif';
    END IF;
END$$;


DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM pg_enum e
        JOIN pg_type t ON e.enumtypid = t.oid
        WHERE t.typname = 'statut_validation_type'
          AND e.enumlabel = 'valide'
    ) THEN
        ALTER TYPE statut_validation_type ADD VALUE 'valide';
    END IF;
END$$;

