64 lines
1.6 KiB
Text
64 lines
1.6 KiB
Text
generator client {
|
|
provider = "prisma-client"
|
|
output = "../src/generated/prisma"
|
|
engineType = "client"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model Community {
|
|
id String @id @unique @default(uuid())
|
|
name String @unique
|
|
description String?
|
|
members User[]
|
|
Channel Channel[]
|
|
Role Role[]
|
|
invites Invite[]
|
|
}
|
|
|
|
model Channel {
|
|
id String @id @unique @default(uuid())
|
|
name String?
|
|
community Community? @relation(fields: [communityId], references: [id])
|
|
communityId String?
|
|
}
|
|
|
|
model Role {
|
|
id String @id @unique @default(uuid())
|
|
name String?
|
|
community Community @relation(fields: [communityId], references: [id])
|
|
communityId String
|
|
}
|
|
|
|
model User {
|
|
id String @id @unique @default(uuid())
|
|
username String @unique
|
|
email String? @unique
|
|
passwordHash String?
|
|
description String?
|
|
admin Boolean @default(false)
|
|
registerDate DateTime @default(now())
|
|
lastLogin DateTime?
|
|
Community Community? @relation(fields: [communityId], references: [id])
|
|
communityId String?
|
|
Session Session[]
|
|
}
|
|
|
|
model Session {
|
|
id String @id @unique @default(uuid())
|
|
owner User @relation(fields: [userId], references: [id])
|
|
token String
|
|
userId String
|
|
}
|
|
|
|
model Invite {
|
|
id String @id @unique @default(uuid())
|
|
Community Community? @relation(fields: [communityId], references: [id])
|
|
communityId String?
|
|
totalInvites Int @default(0)
|
|
remainingInvites Int @default(0)
|
|
creationDate DateTime @default(now())
|
|
expirationDate DateTime?
|
|
}
|