-- CREATE TABLE files (
--     id          INTEGER PRIMARY KEY,
--     path        TEXT    NOT NULL UNIQUE,
--     language    TEXT    NOT NULL,
--     package     TEXT,
--     hash        TEXT    NOT NULL,
--     indexed_at  DATETIME DEFAULT CURRENT_TIMESTAMP
-- );
-- 
-- CREATE TABLE symbols (
--     id          INTEGER PRIMARY KEY,
--     file_id     INTEGER NOT NULL REFERENCES files(id) ON DELETE CASCADE,
--     name        TEXT    NOT NULL,
--     kind        TEXT    NOT NULL CHECK(kind IN (
--         'function', 'method', 'class', 'type',
--         'interface', 'constant', 'variable', 'constructor'
--     )),
--     line        INTEGER NOT NULL,
--     line_end    INTEGER,
--     col         INTEGER,
--     col_end     INTEGER,
--     exported    BOOLEAN,
--     parent_id   INTEGER REFERENCES symbols(id),
--     UNIQUE(file_id, name, kind, line)
-- );
-- 
-- CREATE INDEX idx_symbols_name ON symbols(name);
-- CREATE INDEX idx_symbols_kind ON symbols(kind);
-- CREATE INDEX idx_symbols_file_line ON symbols(file_id, line);
-- CREATE INDEX idx_symbols_parent ON symbols(parent_id);
-- CREATE INDEX idx_symbols_exported ON symbols(exported, kind);
-- CREATE INDEX idx_files_path ON files(path);
-- CREATE INDEX idx_files_language ON files(language);
-- CREATE INDEX idx_files_package ON files(package);
