DROP INDEX IF EXISTS idx_acp_events_created_at;
DROP INDEX IF EXISTS idx_acp_events_session_id;
DROP TABLE IF EXISTS acp_events;

ALTER TABLE workspaces DROP CONSTRAINT IF EXISTS workspaces_active_main_session_fk;
ALTER TABLE workspaces DROP COLUMN IF EXISTS active_main_session_id;

DROP INDEX IF EXISTS idx_acp_sessions_requirement;
DROP INDEX IF EXISTS idx_acp_sessions_issue;
DROP INDEX IF EXISTS idx_acp_sessions_user_status;
DROP INDEX IF EXISTS idx_acp_sessions_workspace_status;
DROP TABLE IF EXISTS acp_sessions;

ALTER TABLE requirements DROP CONSTRAINT IF EXISTS requirements_project_id_unique;
ALTER TABLE issues       DROP CONSTRAINT IF EXISTS issues_project_id_unique;

DROP INDEX IF EXISTS idx_acp_agent_kinds_enabled;
DROP TABLE IF EXISTS acp_agent_kinds;
