mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-22 23:42:00 +00:00
- Replaced 'house_name' with 'address' in user schema and related files. - Added new fields for terms and privacy policy acceptance in the signup form schema. - Updated package.json and package-lock.json to include @radix-ui/react-checkbox for checkbox functionality. - Modified seed script to reflect changes in the user model.
120 lines
2.9 KiB
Plaintext
120 lines
2.9 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified Boolean @default(false)
|
|
firstPaymentDone Boolean @default(false)
|
|
verified Boolean @default(false)
|
|
// island String?
|
|
address String?
|
|
id_card String? @unique
|
|
dob DateTime?
|
|
atoll Atoll? @relation(fields: [atollId], references: [id])
|
|
island Island? @relation(fields: [islandId], references: [id])
|
|
|
|
image String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
phoneNumber String @unique
|
|
phoneNumberVerified Boolean @default(false)
|
|
termsAccepted Boolean @default(false)
|
|
policyAccepted Boolean @default(false)
|
|
|
|
devices Device[]
|
|
|
|
role String?
|
|
lang String?
|
|
atollId String?
|
|
islandId String?
|
|
|
|
@@map("user")
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
token String @unique
|
|
expiresAt DateTime
|
|
ipAddress String?
|
|
userAgent String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("session")
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
accountId String
|
|
providerId String
|
|
accessToken String?
|
|
refreshToken String?
|
|
accessTokenExpiresAt DateTime?
|
|
refreshTokenExpiresAt DateTime?
|
|
scope String?
|
|
password String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
idToken String?
|
|
|
|
@@map("account")
|
|
}
|
|
|
|
model Verification {
|
|
id String @id @default(cuid())
|
|
identifier String
|
|
value String
|
|
expiresAt DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("verification")
|
|
}
|
|
|
|
model Atoll {
|
|
id String @id @default(cuid())
|
|
name String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
islands Island[]
|
|
User User[]
|
|
}
|
|
|
|
model Island {
|
|
id String @id @default(cuid())
|
|
atollId String
|
|
atoll Atoll @relation(fields: [atollId], references: [id])
|
|
name String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
User User[]
|
|
}
|
|
|
|
model Device {
|
|
id String @id @default(cuid())
|
|
name String
|
|
mac String
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
User User? @relation(fields: [userId], references: [id])
|
|
userId String?
|
|
}
|