-- Drop in dependency order: triggers, FTS virtual tables, real tables.
-- Indexes on `sessions` are dropped automatically by DROP TABLE.

DROP TRIGGER IF EXISTS tool_outputs_fts_delete;
DROP TRIGGER IF EXISTS tool_outputs_fts_update;
DROP TRIGGER IF EXISTS tool_outputs_fts_insert;
DROP TRIGGER IF EXISTS turns_fts_delete;
DROP TRIGGER IF EXISTS turns_fts_update;
DROP TRIGGER IF EXISTS turns_fts_insert;

DROP TABLE IF EXISTS tool_outputs_fts;
DROP TABLE IF EXISTS turns_fts;

DROP INDEX IF EXISTS sessions_owner_started;

DROP TABLE IF EXISTS turns;
DROP TABLE IF EXISTS sessions;
