mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
update mysql to latest schema
This commit is contained in:
parent
0b16d06d8c
commit
9078444ca5
@ -19,6 +19,7 @@ model User {
|
||||
|
||||
teamUser TeamUser[]
|
||||
Website Website[]
|
||||
teamWebsite TeamWebsite[]
|
||||
|
||||
@@map("user")
|
||||
}
|
||||
@ -47,15 +48,13 @@ model Website {
|
||||
shareId String? @unique @map("share_id") @db.VarChar(50)
|
||||
revId Int @default(0) @map("rev_id") @db.UnsignedInt
|
||||
userId String? @map("user_id") @db.VarChar(36)
|
||||
teamId String? @map("team_id") @db.VarChar(36)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
deletedAt DateTime? @map("deleted_at") @db.Timestamp(0)
|
||||
|
||||
team Team? @relation(fields: [teamId], references: [id])
|
||||
user User? @relation(fields: [userId], references: [id])
|
||||
teamWebsite TeamWebsite[]
|
||||
|
||||
@@index([teamId])
|
||||
@@index([userId])
|
||||
@@index([createdAt])
|
||||
@@index([shareId])
|
||||
@ -88,10 +87,9 @@ model Team {
|
||||
accessCode String? @unique @map("access_code") @db.VarChar(50)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
deletedAt DateTime? @map("deleted_at") @db.Timestamp(0)
|
||||
|
||||
teamUsers TeamUser[]
|
||||
Website Website[]
|
||||
teamWebsite TeamWebsite[]
|
||||
|
||||
@@index([userId])
|
||||
@@index([accessCode])
|
||||
@ -105,7 +103,6 @@ model TeamUser {
|
||||
role String @map("role") @db.VarChar(50)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
updatedAt DateTime? @map("updated_at") @db.Timestamp(0)
|
||||
deletedAt DateTime? @map("deleted_at") @db.Timestamp(0)
|
||||
|
||||
team Team @relation(fields: [teamId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
@ -114,3 +111,20 @@ model TeamUser {
|
||||
@@index([userId])
|
||||
@@map("team_user")
|
||||
}
|
||||
|
||||
model TeamWebsite {
|
||||
id String @id() @unique() @map("team_website_id") @db.VarChar(36)
|
||||
teamId String @map("team_id") @db.VarChar(36)
|
||||
userId String @map("user_id") @db.VarChar(36)
|
||||
websiteId String @map("website_id") @db.VarChar(36)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
|
||||
team Team @relation(fields: [teamId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
website Website @relation(fields: [websiteId], references: [id])
|
||||
|
||||
@@index([teamId])
|
||||
@@index([userId])
|
||||
@@index([websiteId])
|
||||
@@map("team_website")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user