fix: change PushSubscription endpoint to VARCHAR for MySQL compatibility
MySQL cannot create unique constraints on TEXT fields without length. Changed endpoint from @db.Text to @db.VarChar(512) to fix Prisma generation error.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -23,7 +23,7 @@ yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
# .env
|
||||
.env*.local
|
||||
|
||||
# Vercel
|
||||
|
||||
@@ -26,14 +26,14 @@ model User {
|
||||
model PushSubscription {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
endpoint String @db.Text
|
||||
endpoint String @db.VarChar(512)
|
||||
p256dh String @db.Text
|
||||
auth String @db.Text
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, endpoint(255)])
|
||||
@@unique([userId, endpoint])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user