-
Notifications
You must be signed in to change notification settings - Fork 6
/
schema.prisma
51 lines (44 loc) · 1.17 KB
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}
model Collector {
id String @id @unique
origin String
timestamp DateTime @default(now())
events Event[]
}
model Event {
id String @id @unique
url String
type String @default("pageview")
country String @default("undefined")
city String @default("undefined")
timestamp DateTime @default(now())
collector Collector @relation(fields: [collectorId], references: [id])
collectorId String
}
model Url {
url String @id @unique
totalEvents Int @default(0)
firstSeen DateTime @default(now())
}
model Location {
city String @id @unique
country String
totalEvents Int @default(0)
firstSeen DateTime @default(now())
}
model Daily {
id String @id @unique
url String
type String @default("pageview")
count Int @default(0)
timestamp DateTime @default(now())
}