Skip to content

Commit

Permalink
More prisma update while my brain functions a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohithgilla12 committed Aug 27, 2022
1 parent e793925 commit 6034732
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ datasource db {
}

model ShortLink {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
url String @db.VarChar(2000)
slug String @unique
userId String? @db.VarChar(2000)
user User? @relation(fields: [userId], references: [id])
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
url String @db.VarChar(2000)
slug String @unique
userId String? @db.VarChar(2000)
user User? @relation(fields: [userId], references: [id])
Analytics Analytics[]
@@index(slug)
}
Expand Down Expand Up @@ -72,3 +73,11 @@ model VerificationToken {
@@unique([identifier, token])
}

// Add analytics for shortlinks
model Analytics {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
shortLinkId Int
shortLink ShortLink @relation(fields: [shortLinkId], references: [id], onDelete: Cascade)
}

0 comments on commit 6034732

Please sign in to comment.