CREATE TABLE resource_access_tokens (
    token_hash TEXT PRIMARY KEY,
    resource_kind TEXT NOT NULL,
    resource_slug TEXT NOT NULL,
    expires_at TEXT NOT NULL,
    created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text)
);
CREATE INDEX idx_resource_access_tokens_resource ON resource_access_tokens(resource_kind, resource_slug);
CREATE INDEX idx_resource_access_tokens_expires ON resource_access_tokens(expires_at);
