-- Migration 020: Add sort_order to format_types, rename/reorder entries, add Image
ALTER TABLE format_types ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 99;

UPDATE format_types SET sort_order = 1 WHERE name = 'Écriture';
UPDATE format_types SET sort_order = 3 WHERE name = 'Audio';
UPDATE format_types SET sort_order = 4 WHERE name = 'Vidéo';
UPDATE format_types SET sort_order = 5 WHERE name = 'Site web';
UPDATE format_types SET sort_order = 6 WHERE name = 'Performance';
UPDATE format_types SET sort_order = 7 WHERE name = 'Objet éditorial';
UPDATE format_types SET sort_order = 8 WHERE name = 'Installation';
UPDATE format_types SET sort_order = 9 WHERE name = 'Autre';

INSERT OR IGNORE INTO format_types (name, sort_order) VALUES ('Image', 2);
