mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-25 09:41:54 +01:00
Merge branch 'master' of https://github.com/mikecao/umami
This commit is contained in:
commit
7c752eeeee
@ -9,7 +9,7 @@ datasource db {
|
||||
|
||||
model account {
|
||||
user_id Int @id @default(autoincrement())
|
||||
username String @unique @db.VarChar(255)
|
||||
username String @unique(map: "account.username_unique") @db.VarChar(255)
|
||||
password String @db.VarChar(60)
|
||||
is_admin Boolean @default(false)
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
@ -25,12 +25,12 @@ model event {
|
||||
url String @db.VarChar(500)
|
||||
event_type String @db.VarChar(50)
|
||||
event_value String @db.VarChar(50)
|
||||
session session @relation(fields: [session_id], references: [session_id])
|
||||
website website @relation(fields: [website_id], references: [website_id])
|
||||
session session @relation(fields: [session_id], references: [session_id], onDelete: Cascade)
|
||||
website website @relation(fields: [website_id], references: [website_id], onDelete: Cascade)
|
||||
|
||||
@@index([created_at], name: "event_created_at_idx")
|
||||
@@index([session_id], name: "event_session_id_idx")
|
||||
@@index([website_id], name: "event_website_id_idx")
|
||||
@@index([created_at])
|
||||
@@index([session_id])
|
||||
@@index([website_id])
|
||||
}
|
||||
|
||||
model pageview {
|
||||
@ -40,19 +40,19 @@ model pageview {
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
url String @db.VarChar(500)
|
||||
referrer String? @db.VarChar(500)
|
||||
session session @relation(fields: [session_id], references: [session_id])
|
||||
website website @relation(fields: [website_id], references: [website_id])
|
||||
session session @relation(fields: [session_id], references: [session_id], onDelete: Cascade)
|
||||
website website @relation(fields: [website_id], references: [website_id], onDelete: Cascade)
|
||||
|
||||
@@index([created_at], name: "pageview_created_at_idx")
|
||||
@@index([session_id], name: "pageview_session_id_idx")
|
||||
@@index([website_id, created_at], name: "pageview_website_id_created_at_idx")
|
||||
@@index([website_id], name: "pageview_website_id_idx")
|
||||
@@index([website_id, session_id, created_at], name: "pageview_website_id_session_id_created_at_idx")
|
||||
@@index([created_at])
|
||||
@@index([session_id])
|
||||
@@index([website_id, created_at])
|
||||
@@index([website_id])
|
||||
@@index([website_id, session_id, created_at])
|
||||
}
|
||||
|
||||
model session {
|
||||
session_id Int @id @default(autoincrement())
|
||||
session_uuid String @unique @db.Uuid
|
||||
session_uuid String @unique(map: "session.session_uuid_unique") @db.Uuid
|
||||
website_id Int
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
hostname String? @db.VarChar(100)
|
||||
@ -62,26 +62,26 @@ model session {
|
||||
screen String? @db.VarChar(11)
|
||||
language String? @db.VarChar(35)
|
||||
country String? @db.Char(2)
|
||||
website website @relation(fields: [website_id], references: [website_id])
|
||||
website website @relation(fields: [website_id], references: [website_id], onDelete: Cascade)
|
||||
event event[]
|
||||
pageview pageview[]
|
||||
|
||||
@@index([created_at], name: "session_created_at_idx")
|
||||
@@index([website_id], name: "session_website_id_idx")
|
||||
@@index([created_at])
|
||||
@@index([website_id])
|
||||
}
|
||||
|
||||
model website {
|
||||
website_id Int @id @default(autoincrement())
|
||||
website_uuid String @unique @db.Uuid
|
||||
website_uuid String @unique(map: "website.website_uuid_unique") @db.Uuid
|
||||
user_id Int
|
||||
name String @db.VarChar(100)
|
||||
domain String? @db.VarChar(500)
|
||||
share_id String? @unique @db.VarChar(64)
|
||||
share_id String? @unique(map: "website.share_id_unique") @db.VarChar(64)
|
||||
created_at DateTime? @default(now()) @db.Timestamptz(6)
|
||||
account account @relation(fields: [user_id], references: [user_id])
|
||||
account account @relation(fields: [user_id], references: [user_id], onDelete: Cascade)
|
||||
event event[]
|
||||
pageview pageview[]
|
||||
session session[]
|
||||
|
||||
@@index([user_id], name: "website_user_id_idx")
|
||||
}
|
||||
@@index([user_id])
|
||||
}
|
Loading…
Reference in New Issue
Block a user