mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-28 05:37:49 +02:00
🗃️ Store active space for user (#1807)
This commit is contained in:
parent
d93baeafd9
commit
d672eb1012
15 changed files with 196 additions and 94 deletions
|
@ -10,7 +10,8 @@ model Space {
|
|||
scheduledEvents ScheduledEvent[]
|
||||
subscription Subscription? @relation("SpaceToSubscription")
|
||||
|
||||
members SpaceMember[]
|
||||
members SpaceMember[]
|
||||
activeForUsers User[] @relation("UserActiveSpace")
|
||||
|
||||
@@index([ownerId], type: Hash)
|
||||
@@map("spaces")
|
||||
|
|
|
@ -49,6 +49,7 @@ model User {
|
|||
bannedAt DateTime? @map("banned_at")
|
||||
banReason String? @map("ban_reason")
|
||||
role UserRole @default(user)
|
||||
activeSpaceId String? @map("active_space_id")
|
||||
|
||||
comments Comment[]
|
||||
polls Poll[]
|
||||
|
@ -57,6 +58,7 @@ model User {
|
|||
participants Participant[]
|
||||
paymentMethods PaymentMethod[]
|
||||
subscription Subscription? @relation("UserToSubscription")
|
||||
activeSpace Space? @relation("UserActiveSpace", fields: [activeSpaceId], references: [id], onDelete: SetNull)
|
||||
|
||||
spaces Space[] @relation("UserSpaces")
|
||||
memberOf SpaceMember[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue