Moved models to simplify and improve prisma schemas , added logic to update characterTypes

This commit is contained in:
2024-11-17 17:53:25 +01:00
parent 27f8bc8784
commit ec3bf0f51e
14 changed files with 80 additions and 103 deletions

View File

@ -1,11 +1,11 @@
model User {
id Int @id @default(autoincrement())
username String @unique
email String @unique
password String
online Boolean @default(false)
characters Character[]
passwordResetTokens PasswordResetToken[]
id Int @id @default(autoincrement())
username String @unique
email String @unique
password String
online Boolean @default(false)
characters Character[]
passwordResetTokens PasswordResetToken[]
}
model PasswordResetToken {
@ -30,15 +30,16 @@ enum CharacterRace {
}
model CharacterType {
id Int @id @default(autoincrement())
name String
gender CharacterGender
race CharacterRace
characters Character[]
spriteId String?
sprite Sprite? @relation(fields: [spriteId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
name String
gender CharacterGender
race CharacterRace
isEnabledForCharCreation Boolean @default(false)
characters Character[]
spriteId String?
sprite Sprite? @relation(fields: [spriteId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Character {
@ -71,4 +72,4 @@ model CharacterItem {
itemId String
item Item @relation(fields: [itemId], references: [id], onDelete: Cascade)
quantity Int
}
}