-- Add name (human-readable title) and enabled (show/hide toggle) columns
-- to form_help_blocks. Drop sort_order — blocks are now fixed-position,
-- one per fieldset, no reordering.

ALTER TABLE form_help_blocks ADD COLUMN name TEXT NOT NULL DEFAULT '';
ALTER TABLE form_help_blocks ADD COLUMN enabled INTEGER NOT NULL DEFAULT 1;

-- Backfill names from the FORM_HELP_LABELS mapping.
UPDATE form_help_blocks SET name = 'Introduction'              WHERE key = 'partage_intro';
UPDATE form_help_blocks SET name = 'Informations du TFE'       WHERE key = 'fieldset_tfe_info';
UPDATE form_help_blocks SET name = 'Note Synopsis'             WHERE key = 'fieldset_synopsis';
UPDATE form_help_blocks SET name = 'Composition du jury'       WHERE key = 'fieldset_jury';
UPDATE form_help_blocks SET name = 'Cadre académique'          WHERE key = 'fieldset_academic';
UPDATE form_help_blocks SET name = 'Fichiers'                  WHERE key = 'fieldset_files';
UPDATE form_help_blocks SET name = 'Visibilité / Accès'        WHERE key = 'fieldset_access';
UPDATE form_help_blocks SET name = 'E-mail de confirmation'    WHERE key = 'fieldset_email';
