DROP TABLE bot_keys;

CREATE TABLE bot_keys (
    id          TEXT PRIMARY KEY,
    tenant      TEXT NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
    bot         TEXT NOT NULL REFERENCES bots(id) ON DELETE CASCADE,
    secret      TEXT NOT NULL,
    created_at  TEXT NOT NULL,
    expires_at  TEXT NOT NULL
);

CREATE INDEX idx_bot_keys_bot ON bot_keys(bot);
CREATE INDEX idx_bot_keys_tenant ON bot_keys(tenant);
