-- CreateTable CREATE TABLE "PersonalAccessToken" ( "id" TEXT NOT NULL, "userUid" TEXT NOT NULL, "label" TEXT NOT NULL, "token" TEXT NOT NULL, "expiresOn" TIMESTAMP(3), "createdOn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedOn" TIMESTAMP(3) NOT NULL, CONSTRAINT "PersonalAccessToken_pkey" PRIMARY KEY ("id") ); -- CreateIndex CREATE UNIQUE INDEX "PersonalAccessToken_token_key" ON "PersonalAccessToken"("token"); -- AddForeignKey ALTER TABLE "PersonalAccessToken" ADD CONSTRAINT "PersonalAccessToken_userUid_fkey" FOREIGN KEY ("userUid") REFERENCES "User"("uid") ON DELETE CASCADE ON UPDATE CASCADE;