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:
2025-12-07 01:50:28 +00:00
parent 374bfb3a62
commit 298ebc5fb9
2 changed files with 3 additions and 3 deletions

View File

@@ -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])
}