chore: changed the names of properties for User in prisma and user.model

This commit is contained in:
Balu Babu
2023-01-19 05:19:47 +05:30
parent 364381f017
commit 8fdcc5dd50
2 changed files with 8 additions and 8 deletions

View File

@@ -79,10 +79,10 @@ model TeamEnvironment {
} }
model User { model User {
id String @id @default(cuid()) uid String @id @default(cuid()) @map("id")
name String? displayName String?
email String? @unique email String? @unique
image String? photoURL String?
isAdmin Boolean @default(false) isAdmin Boolean @default(false)
refreshToken String? refreshToken String?
accounts Account[] accounts Account[]
@@ -100,7 +100,7 @@ model Account {
providerScope String? providerScope String?
loggedIn DateTime @default(now()) @db.Timestamp(3) loggedIn DateTime @default(now()) @db.Timestamp(3)
user User @relation(fields: [userId], references: [id], onDelete: Cascade) user User @relation(fields: [userId], references: [uid], onDelete: Cascade)
@@unique(fields: [provider, providerAccountId], name: "verifyProviderAccount") @@unique(fields: [provider, providerAccountId], name: "verifyProviderAccount")
} }
@@ -109,7 +109,7 @@ model PasswordlessVerification {
deviceIdentifier String deviceIdentifier String
token String @unique @default(cuid()) token String @unique @default(cuid())
userUid String userUid String
user User @relation(fields: [userUid], references: [id], onDelete: Cascade) user User @relation(fields: [userUid], references: [uid], onDelete: Cascade)
expiresOn DateTime @db.Timestamp(3) expiresOn DateTime @db.Timestamp(3)
@@unique(fields: [deviceIdentifier, token], name: "passwordless_deviceIdentifier_tokens") @@unique(fields: [deviceIdentifier, token], name: "passwordless_deviceIdentifier_tokens")

View File

@@ -5,13 +5,13 @@ export class User {
@Field(() => ID, { @Field(() => ID, {
description: 'ID of the user', description: 'ID of the user',
}) })
id: string; uid: string;
@Field({ @Field({
nullable: true, nullable: true,
description: 'Name of the user (if fetched)', description: 'Name of the user (if fetched)',
}) })
name?: string; displayName?: string;
@Field({ @Field({
nullable: true, nullable: true,
@@ -23,7 +23,7 @@ export class User {
nullable: true, nullable: true,
description: 'URL to the profile photo of the user (if fetched)', description: 'URL to the profile photo of the user (if fetched)',
}) })
image?: string; photoURL?: string;
@Field({ @Field({
description: 'Flag to determine if user is an Admin or not', description: 'Flag to determine if user is an Admin or not',