New controllers and services; Auth
This commit is contained in:
parent
2fc0f9c404
commit
d17f37749d
35 changed files with 1040 additions and 164 deletions
|
|
@ -1,64 +1,76 @@
|
|||
generator client {
|
||||
provider = "prisma-client"
|
||||
output = "../src/generated/prisma"
|
||||
engineType = "client"
|
||||
provider = "prisma-client"
|
||||
output = "../src/generated/prisma"
|
||||
engineType = "client"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
model Community {
|
||||
id String @id @unique @default(uuid())
|
||||
name String @unique
|
||||
description String?
|
||||
members User[]
|
||||
Channel Channel[]
|
||||
Role Role[]
|
||||
invites Invite[]
|
||||
id String @id @unique @default(uuid())
|
||||
name String @unique
|
||||
description String?
|
||||
creationDate DateTime @default(now())
|
||||
User User @relation(name: "OwnerCommunityToUser", fields: [ownerId], references: [id])
|
||||
ownerId String
|
||||
members User[] @relation(name: "MembersCommunitiesToUsers")
|
||||
channels Channel[]
|
||||
roles Role[]
|
||||
invites Invite[]
|
||||
}
|
||||
|
||||
model Channel {
|
||||
id String @id @unique @default(uuid())
|
||||
name String?
|
||||
community Community? @relation(fields: [communityId], references: [id])
|
||||
communityId String?
|
||||
id String @id @unique @default(uuid())
|
||||
name String?
|
||||
community Community? @relation(fields: [communityId], references: [id])
|
||||
communityId String?
|
||||
creationDate DateTime @default(now())
|
||||
}
|
||||
|
||||
model Role {
|
||||
id String @id @unique @default(uuid())
|
||||
name String?
|
||||
community Community @relation(fields: [communityId], references: [id])
|
||||
communityId String
|
||||
id String @id @unique @default(uuid())
|
||||
name String?
|
||||
community Community @relation(fields: [communityId], references: [id])
|
||||
communityId String
|
||||
users User[] @relation(name: "UsersRolesToUsers")
|
||||
permissions String[]
|
||||
creationDate DateTime @default(now())
|
||||
}
|
||||
|
||||
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[]
|
||||
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?
|
||||
Session Session[]
|
||||
ownedInvites Invite[]
|
||||
ownedCommunities Community[] @relation(name: "OwnerCommunityToUser")
|
||||
communities Community[] @relation(name: "MembersCommunitiesToUsers")
|
||||
roles Role[] @relation(name: "UsersRolesToUsers")
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @unique @default(uuid())
|
||||
owner User @relation(fields: [userId], references: [id])
|
||||
token String
|
||||
userId String
|
||||
id String @id @unique @default(uuid())
|
||||
owner User @relation(fields: [userId], references: [id])
|
||||
userId String
|
||||
token String
|
||||
creationDate DateTime @default(now())
|
||||
}
|
||||
|
||||
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?
|
||||
id String @id @unique @default(uuid())
|
||||
Community Community @relation(fields: [communityId], references: [id])
|
||||
communityId String
|
||||
User User @relation(fields: [creatorId], references: [id])
|
||||
creatorId String
|
||||
totalInvites Int @default(0)
|
||||
remainingInvites Int @default(0)
|
||||
creationDate DateTime @default(now())
|
||||
expirationDate DateTime?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue