/* Warnings: - Added the required column `password` to the `User` table without a default value. This is not possible if the table is not empty. */ -- CreateTable CREATE TABLE "Session" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "expiresAt" DATETIME NOT NULL, "sessionToken" TEXT NOT NULL, "accessToken" TEXT NOT NULL, "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" DATETIME NOT NULL, "userId" INTEGER NOT NULL, CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE ); -- RedefineTables PRAGMA defer_foreign_keys=ON; PRAGMA foreign_keys=OFF; CREATE TABLE "new_User" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "email" TEXT, "name" TEXT NOT NULL, "password" TEXT NOT NULL, "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); INSERT INTO "new_User" ("createdAt", "email", "id", "name", "updatedAt") SELECT "createdAt", "email", "id", "name", "updatedAt" FROM "User"; DROP TABLE "User"; ALTER TABLE "new_User" RENAME TO "User"; CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); PRAGMA foreign_keys=ON; PRAGMA defer_foreign_keys=OFF; -- CreateIndex CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken"); -- CreateIndex CREATE UNIQUE INDEX "Session_accessToken_key" ON "Session"("accessToken");