Repository Public
1-- Rollback of 004. Drafts, prompts and custom presets are deleted (export them first: Réglages → Données).2BEGIN;3ALTER TABLE research_runs DROP COLUMN IF EXISTS depth, DROP COLUMN IF EXISTS state, DROP COLUMN IF EXISTS updated_at, DROP COLUMN IF EXISTS assistant_message_id, DROP COLUMN IF EXISTS attempts;4DROP INDEX IF EXISTS attachments_message_idx;5ALTER TABLE attachments DROP COLUMN IF EXISTS index_status, DROP COLUMN IF EXISTS index_error, DROP COLUMN IF EXISTS chunk_count, DROP COLUMN IF EXISTS indexed_at;6DROP TABLE IF EXISTS presets;7DROP TABLE IF EXISTS prompts;8DROP TABLE IF EXISTS drafts;9DROP INDEX IF EXISTS conversations_favorite_idx; DROP INDEX IF EXISTS conversations_list_idx;10ALTER TABLE conversations DROP COLUMN IF EXISTS favorite, DROP COLUMN IF EXISTS preset_id;11DROP INDEX IF EXISTS messages_streaming_idx; DROP INDEX IF EXISTS messages_client_request_idx;12UPDATE messages SET status = 'error' WHERE status = 'incomplete';13ALTER TABLE messages DROP COLUMN IF EXISTS client_request_id, DROP COLUMN IF EXISTS error_code, DROP COLUMN IF EXISTS stop_reason, DROP COLUMN IF EXISTS run_id;14DELETE FROM schema_migrations WHERE name = '004_workflow_library.sql';15COMMIT;16