2020-07-17 10:03:38 +02:00
|
|
|
generator client {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model event {
|
|
|
|
created_at DateTime? @default(now())
|
|
|
|
event_id Int @default(autoincrement()) @id
|
|
|
|
event_type String
|
|
|
|
event_value String
|
|
|
|
session_id String?
|
|
|
|
url String
|
|
|
|
session session? @relation(fields: [session_id], references: [session_id])
|
2020-07-18 04:33:40 +02:00
|
|
|
|
|
|
|
@@index([created_at], name: "event_created_at_idx")
|
2020-07-17 10:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model pageview {
|
|
|
|
created_at DateTime? @default(now())
|
|
|
|
referrer String?
|
|
|
|
session_id String?
|
|
|
|
url String
|
|
|
|
view_id Int @default(autoincrement()) @id
|
|
|
|
session session? @relation(fields: [session_id], references: [session_id])
|
2020-07-18 04:33:40 +02:00
|
|
|
|
|
|
|
@@index([created_at], name: "pageview_created_at_idx")
|
2020-07-17 10:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model session {
|
|
|
|
browser String?
|
|
|
|
country String?
|
|
|
|
created_at DateTime? @default(now())
|
2020-07-18 19:36:46 +02:00
|
|
|
hostname String?
|
2020-07-17 10:03:38 +02:00
|
|
|
language String?
|
|
|
|
os String?
|
|
|
|
screen String?
|
|
|
|
session_id String @id
|
|
|
|
website_id String?
|
|
|
|
website website? @relation(fields: [website_id], references: [website_id])
|
|
|
|
event event[]
|
|
|
|
pageview pageview[]
|
2020-07-18 04:33:40 +02:00
|
|
|
|
|
|
|
@@index([created_at], name: "session_created_at_idx")
|
2020-07-17 10:03:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
model website {
|
|
|
|
created_at DateTime? @default(now())
|
|
|
|
hostname String @unique
|
|
|
|
website_id String @id
|
|
|
|
session session[]
|
|
|
|
}
|