mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-16 04:10:35 +01:00
22 lines
934 B
SQL
22 lines
934 B
SQL
/*
|
|
Warnings:
|
|
|
|
- The primary key for the `RefreshToken` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
|
- The required column `id` was added to the `RefreshToken` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required.
|
|
|
|
*/
|
|
-- RedefineTables
|
|
PRAGMA foreign_keys=OFF;
|
|
DROP TABLE "RefreshToken";
|
|
CREATE TABLE "RefreshToken" (
|
|
"id" TEXT NOT NULL PRIMARY KEY,
|
|
"token" TEXT NOT NULL,
|
|
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"expiresAt" DATETIME NOT NULL,
|
|
"userId" TEXT NOT NULL,
|
|
CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
|
);
|
|
CREATE UNIQUE INDEX "RefreshToken_token_key" ON "RefreshToken"("token");
|
|
PRAGMA foreign_key_check;
|
|
PRAGMA foreign_keys=ON;
|