103 lines
2.6 KiB
Plaintext
103 lines
2.6 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
enum Specialty {
|
|
ZOMBIE
|
|
SHADOW
|
|
}
|
|
|
|
enum Zone {
|
|
WORLD
|
|
DUNGEON
|
|
}
|
|
|
|
enum ItemSlot {
|
|
WEAPON
|
|
ARMOR
|
|
ACCESSORY
|
|
CONSUMABLE
|
|
}
|
|
|
|
enum ArmyUnitType {
|
|
ZOMBIE
|
|
SHADOW
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
email String @unique
|
|
passwordHash String
|
|
createdAt DateTime @default(now())
|
|
character Character?
|
|
}
|
|
|
|
model Character {
|
|
id String @id @default(cuid())
|
|
userId String @unique
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
name String
|
|
specialty Specialty
|
|
level Int @default(1)
|
|
xp Int @default(0)
|
|
unspentStatPoints Int @default(0)
|
|
hp Int @default(100)
|
|
maxHp Int @default(100)
|
|
energy Int @default(50)
|
|
maxEnergy Int @default(50)
|
|
str Int @default(5)
|
|
dex Int @default(5)
|
|
int Int @default(5)
|
|
mapX Int @default(5)
|
|
mapY Int @default(5)
|
|
currentZone Zone @default(WORLD)
|
|
dungeonFloor Int @default(0)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
inventory InventoryItem[]
|
|
army ArmyUnit[]
|
|
}
|
|
|
|
model Item {
|
|
id String @id @default(cuid())
|
|
key String @unique
|
|
name String
|
|
description String
|
|
slot ItemSlot
|
|
strBonus Int @default(0)
|
|
dexBonus Int @default(0)
|
|
intBonus Int @default(0)
|
|
hpBonus Int @default(0)
|
|
rarity String @default("common")
|
|
inventory InventoryItem[]
|
|
}
|
|
|
|
model InventoryItem {
|
|
id String @id @default(cuid())
|
|
characterId String
|
|
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
|
itemId String
|
|
item Item @relation(fields: [itemId], references: [id])
|
|
equipped Boolean @default(false)
|
|
quantity Int @default(1)
|
|
|
|
@@index([characterId])
|
|
}
|
|
|
|
model ArmyUnit {
|
|
id String @id @default(cuid())
|
|
characterId String
|
|
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
|
type ArmyUnitType
|
|
tier Int @default(1)
|
|
count Int @default(1)
|
|
|
|
@@unique([characterId, type, tier])
|
|
@@index([characterId])
|
|
}
|