migration.sql 650 B

12345678910111213141516171819
  1. -- CreateTable
  2. CREATE TABLE "PersonalAccessToken" (
  3. "id" TEXT NOT NULL,
  4. "userUid" TEXT NOT NULL,
  5. "label" TEXT NOT NULL,
  6. "token" TEXT NOT NULL,
  7. "expiresOn" TIMESTAMP(3),
  8. "createdOn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  9. "updatedOn" TIMESTAMP(3) NOT NULL,
  10. CONSTRAINT "PersonalAccessToken_pkey" PRIMARY KEY ("id")
  11. );
  12. -- CreateIndex
  13. CREATE UNIQUE INDEX "PersonalAccessToken_token_key" ON "PersonalAccessToken"("token");
  14. -- AddForeignKey
  15. ALTER TABLE "PersonalAccessToken" ADD CONSTRAINT "PersonalAccessToken_userUid_fkey" FOREIGN KEY ("userUid") REFERENCES "User"("uid") ON DELETE CASCADE ON UPDATE CASCADE;