Skip to content

Instantly share code, notes, and snippets.

@marr
Created April 9, 2022 16:09
Show Gist options
  • Save marr/0b2e6a58858388df6b448f5d1d2dd879 to your computer and use it in GitHub Desktop.
Save marr/0b2e6a58858388df6b448f5d1d2dd879 to your computer and use it in GitHub Desktop.
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model TwitterUser {
id String @id @map("_id")
name String
profileImageUrl String
publicMetrics Json
tweets Tweet[]
url String
username String
verified Boolean
}
model Tweet {
id String @id @map("_id")
author TwitterUser @relation(fields: [authorId], references: [id])
authorId String
createdAt DateTime
entities Json
media Media[] @relation(fields: [mediaKeys], references: [mediaKey])
mediaKeys String[]
publicMetrics Json
text String
type String?
// referenced_tweets
}
model Media {
mediaKey String @id @map("_id")
tweetIds String[]
tweets Tweet[] @relation(fields: [tweetIds], references: [id])
type String
url String
width Int
height Int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment