mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
22 lines
855 B
MySQL
22 lines
855 B
MySQL
|
|
-- CreateTable
|
||
|
|
CREATE TABLE "AccountRequest" (
|
||
|
|
"id" TEXT NOT NULL,
|
||
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
"requestedById" TEXT NOT NULL,
|
||
|
|
"orgId" INTEGER NOT NULL,
|
||
|
|
|
||
|
|
CONSTRAINT "AccountRequest_pkey" PRIMARY KEY ("id")
|
||
|
|
);
|
||
|
|
|
||
|
|
-- CreateIndex
|
||
|
|
CREATE UNIQUE INDEX "AccountRequest_requestedById_key" ON "AccountRequest"("requestedById");
|
||
|
|
|
||
|
|
-- CreateIndex
|
||
|
|
CREATE UNIQUE INDEX "AccountRequest_requestedById_orgId_key" ON "AccountRequest"("requestedById", "orgId");
|
||
|
|
|
||
|
|
-- AddForeignKey
|
||
|
|
ALTER TABLE "AccountRequest" ADD CONSTRAINT "AccountRequest_requestedById_fkey" FOREIGN KEY ("requestedById") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||
|
|
|
||
|
|
-- AddForeignKey
|
||
|
|
ALTER TABLE "AccountRequest" ADD CONSTRAINT "AccountRequest_orgId_fkey" FOREIGN KEY ("orgId") REFERENCES "Org"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|