CREATE TABLE IF NOT EXISTS kv_store (
    key TEXT PRIMARY KEY,
    value BLOB
);

CREATE TABLE IF NOT EXISTS ratelimit_queues (
    queue_type TEXT NOT NULL,
    msg_id TEXT NOT NULL,
    msg_data BLOB NOT NULL,
    batch_id INTEGER NOT NULL,
    created_at INTEGER NOT NULL,
    PRIMARY KEY (queue_type, batch_id, msg_id)
);