CREATE TABLE IF NOT EXISTS vault_files (
    vault_id    TEXT NOT NULL,
    vault_name  TEXT NOT NULL,
    rel_path    TEXT NOT NULL,
    size        INTEGER NOT NULL,
    mtime       INTEGER NOT NULL,
    sha256      TEXT NOT NULL,
    mime        TEXT NOT NULL DEFAULT '',
    ext         TEXT NOT NULL DEFAULT '',
    bucket      TEXT NOT NULL DEFAULT '',
    sub_bucket  TEXT NOT NULL DEFAULT '',
    indexed_at  INTEGER NOT NULL,
    PRIMARY KEY (vault_id, rel_path)
);
CREATE INDEX IF NOT EXISTS idx_vault_files_sha256 ON vault_files(sha256);
CREATE INDEX IF NOT EXISTS idx_vault_files_vault ON vault_files(vault_id);
