User registration.

This commit is contained in:
Daniel
2023-01-31 15:06:56 +03:30
parent 4cd0e8799c
commit 882bbd64d1
12 changed files with 231 additions and 11 deletions
+37
View File
@@ -0,0 +1,37 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
name String
username String
password String
collections UserAndCollection[]
}
model Collection {
id String @id @default(cuid())
name String
users UserAndCollection[]
}
model UserAndCollection {
user User @relation(fields: [userId], references: [id])
userId String
collection Collection @relation(fields: [collectionId], references: [id])
collectionId String
role String
@@id([userId, collectionId])
}