27 lines
1.1 KiB
SQL
27 lines
1.1 KiB
SQL
/*
|
|
Warnings:
|
|
|
|
- You are about to drop the column `name` on the `User` table. All the data in the column will be lost.
|
|
- Added the required column `firstName` to the `User` table without a default value. This is not possible if the table is not empty.
|
|
- Added the required column `lastName` to the `User` table without a default value. This is not possible if the table is not empty.
|
|
|
|
*/
|
|
-- RedefineTables
|
|
PRAGMA foreign_keys=OFF;
|
|
CREATE TABLE "new_User" (
|
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
"firstName" TEXT NOT NULL,
|
|
"lastName" TEXT NOT NULL,
|
|
"email" TEXT NOT NULL,
|
|
"hashedPassword" TEXT NOT NULL,
|
|
"salt" TEXT NOT NULL,
|
|
"resetToken" TEXT,
|
|
"resetTokenExpiresAt" DATETIME
|
|
);
|
|
INSERT INTO "new_User" ("email", "hashedPassword", "id", "resetToken", "resetTokenExpiresAt", "salt") SELECT "email", "hashedPassword", "id", "resetToken", "resetTokenExpiresAt", "salt" FROM "User";
|
|
DROP TABLE "User";
|
|
ALTER TABLE "new_User" RENAME TO "User";
|
|
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
|
PRAGMA foreign_key_check;
|
|
PRAGMA foreign_keys=ON;
|