-- CreateTable
CREATE TABLE "AuthorizedBot" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "userId" TEXT NOT NULL,
    "botUserId" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT "AuthorizedBot_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);

-- CreateIndex
CREATE INDEX "AuthorizedBot_botUserId_idx" ON "AuthorizedBot"("botUserId");

-- CreateIndex
CREATE UNIQUE INDEX "AuthorizedBot_userId_botUserId_key" ON "AuthorizedBot"("userId", "botUserId");
