2024-11-24 23:30:44 +05:00
|
|
|
// 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 = "sqlite"
|
|
|
|
url = "file:./dev.db"
|
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
2024-11-27 07:48:16 +05:00
|
|
|
id String @id @default(cuid())
|
2024-11-24 23:30:44 +05:00
|
|
|
name String?
|
2024-11-27 07:48:16 +05:00
|
|
|
email String? @unique
|
|
|
|
emailVerified Boolean @default(false)
|
|
|
|
firstPaymentDone Boolean @default(false)
|
|
|
|
verified Boolean @default(false)
|
|
|
|
// island String?
|
|
|
|
house_name String?
|
|
|
|
id_card String? @unique
|
|
|
|
dob DateTime?
|
|
|
|
atoll Atoll? @relation(fields: [atollId], references: [id])
|
|
|
|
island Island? @relation(fields: [islandId], references: [id])
|
2024-11-24 23:30:44 +05:00
|
|
|
|
|
|
|
image String?
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
phoneNumber String @unique
|
|
|
|
phoneNumberVerified Boolean @default(false)
|
|
|
|
|
2024-11-27 07:48:16 +05:00
|
|
|
role String?
|
|
|
|
lang String?
|
|
|
|
atollId String?
|
|
|
|
islandId String?
|
2024-11-24 23:30:44 +05:00
|
|
|
|
|
|
|
@@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")
|
|
|
|
}
|
2024-11-27 07:48:16 +05:00
|
|
|
|
|
|
|
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[]
|
|
|
|
}
|