-- Add sort_order to form_help_blocks for drag-and-drop reordering in admin.
ALTER TABLE form_help_blocks ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0;

-- Assign initial order matching the canonical FORM_HELP_KEYS array index.
UPDATE form_help_blocks SET sort_order = 0 WHERE key = 'partage_intro';
UPDATE form_help_blocks SET sort_order = 1 WHERE key = 'fieldset_tfe_info';
UPDATE form_help_blocks SET sort_order = 2 WHERE key = 'fieldset_synopsis';
UPDATE form_help_blocks SET sort_order = 3 WHERE key = 'fieldset_jury';
UPDATE form_help_blocks SET sort_order = 4 WHERE key = 'fieldset_academic';
UPDATE form_help_blocks SET sort_order = 5 WHERE key = 'fieldset_files';
UPDATE form_help_blocks SET sort_order = 6 WHERE key = 'fieldset_access';
UPDATE form_help_blocks SET sort_order = 7 WHERE key = 'fieldset_email';
