2 provider = "prisma-client-js"
6 provider = "postgresql"
7 url = env("DATABASE_URL")
24 id String @id @default(uuid()) @db.Uuid
26 playerId String? @db.Uuid
28 maxSteps Int @default(500)
32 id String @id @default(uuid()) @db.Uuid
33 username String @unique
36 currency Int @default(0)
45 statPoints Int @default(0)
47 zoneBiome ZoneBiomes @relation(fields: [zoneBiomeId], references: [id])
48 zoneBiomeId String @db.Uuid
51 activeDrops WorldDrop[]
78 id String @id @default(uuid()) @db.Uuid
81 durability Int @default(0)
82 minLevelDrop Int @default(1)
85 instances Inventory[] // a list of all inventories of a particular item
87 worldDrops WorldDrop[] // a list of all active world drops
91 id String @id @default(uuid()) @db.Uuid
92 baseItem Item @relation(fields: [itemId], references: [id])
93 itemId String @db.Uuid
94 dropDate DateTime @default(now())
95 droppedBy Player @relation(fields: [droppedById], references: [id])
96 droppedById String @db.Uuid
100 id String @id @default(uuid()) @db.Uuid
101 player Player @relation(fields: [playerId], references: [id])
102 playerId String @db.Uuid
103 baseItem Item @relation(fields: [itemId], references: [id])
104 itemId String @db.Uuid
105 discovered Boolean @default(false)
106 usesUntilDiscovery Int @default(40)
107 maxDurability Int @default(1) // this is set to 1 to handle things like potions
108 currentDurability Int @default(1)
112 stackable Boolean @default(false) // if an item is "stackable" then the durability is the total number of items in that stack
116 token String @id @default(uuid()) @db.Uuid
117 player Player @relation(fields: [playerId], references: [id])
118 playerId String @db.Uuid
119 createdAt DateTime @default(now())
120 updatedAt DateTime? @updatedAt
133 id String @id @default(uuid()) @db.Uuid
135 monsterType MonsterType[]
136 monsterBiomes MonsterBiome[]
140 id String @id @default(uuid()) @db.Uuid
141 monster Monster @relation(fields: [monsterId], references: [id])
142 monsterId String @db.Uuid
145 dropRate Decimal @default(0.1)
147 lootTable LootTable[]
148 @@unique([monsterId, biome])
152 monsterBiome MonsterBiome @relation(fields: [monsterBiomeId], references: [id])
153 monsterBiomeId String @db.Uuid
154 item Item @relation(fields: [itemId], references: [id])
155 itemId String @db.Uuid
157 @@id([monsterBiomeId, itemId])
161 id String @id @default(uuid()) @db.Uuid
162 playerId String? @db.Uuid
163 monsterId String @db.Uuid