mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-21 12:56:21 +02:00
♻️ Switch to next-auth for handling authentication (#899)
This commit is contained in:
parent
5f9e428432
commit
6fa66da681
65 changed files with 1514 additions and 1586 deletions
|
@ -0,0 +1,28 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "email_verified" TIMESTAMP(3),
|
||||
ADD COLUMN "locale" TEXT,
|
||||
ADD COLUMN "time_format" "time_format",
|
||||
ADD COLUMN "time_zone" TEXT,
|
||||
ADD COLUMN "week_start" INTEGER;
|
||||
|
||||
-- Copy user preferences from old table
|
||||
UPDATE "users" u
|
||||
SET
|
||||
"time_zone" = up."time_zone",
|
||||
"week_start" = up."week_start",
|
||||
"time_format" = up."time_format"
|
||||
FROM "user_preferences" up
|
||||
WHERE u.id = up."user_id";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "verification_tokens" (
|
||||
"identifier" TEXT NOT NULL,
|
||||
"token" TEXT NOT NULL,
|
||||
"expires" TIMESTAMP(3) NOT NULL
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "verification_tokens_token_key" ON "verification_tokens"("token");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "verification_tokens_identifier_token_key" ON "verification_tokens"("identifier", "token");
|
|
@ -17,18 +17,24 @@ enum TimeFormat {
|
|||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
email String @unique() @db.Citext
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime? @updatedAt @map("updated_at")
|
||||
comments Comment[]
|
||||
polls Poll[]
|
||||
watcher Watcher[]
|
||||
events Event[]
|
||||
customerId String? @map("customer_id")
|
||||
subscription Subscription? @relation(fields: [subscriptionId], references: [id])
|
||||
subscriptionId String? @unique @map("subscription_id")
|
||||
email String @unique() @db.Citext
|
||||
emailVerified DateTime? @map("email_verified")
|
||||
timeZone String? @map("time_zone")
|
||||
weekStart Int? @map("week_start")
|
||||
timeFormat TimeFormat? @map("time_format")
|
||||
locale String?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime? @updatedAt @map("updated_at")
|
||||
customerId String? @map("customer_id")
|
||||
subscriptionId String? @unique @map("subscription_id")
|
||||
|
||||
comments Comment[]
|
||||
polls Poll[]
|
||||
watcher Watcher[]
|
||||
events Event[]
|
||||
subscription Subscription? @relation(fields: [subscriptionId], references: [id])
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
|
@ -70,6 +76,7 @@ model Subscription {
|
|||
@@map("subscriptions")
|
||||
}
|
||||
|
||||
// @deprecated
|
||||
model UserPreferences {
|
||||
userId String @id @map("user_id")
|
||||
timeZone String? @map("time_zone")
|
||||
|
@ -219,3 +226,12 @@ model Comment {
|
|||
@@index([pollId], type: Hash)
|
||||
@@map("comments")
|
||||
}
|
||||
|
||||
model VerificationToken {
|
||||
identifier String
|
||||
token String @unique
|
||||
expires DateTime
|
||||
|
||||
@@unique([identifier, token])
|
||||
@@map("verification_tokens")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue