Initial code
This commit is contained in:
parent
f4a1afe71b
commit
c6d3e066c9
21 changed files with 2446 additions and 0 deletions
52
prisma/schema.prisma
Normal file
52
prisma/schema.prisma
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
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
|
||||
members User[]
|
||||
Channel Channel[]
|
||||
Role Role[]
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue