1
0
forked from noxious/server

Updated Prisma models for storing zone event tile teleport data

This commit is contained in:
2024-08-21 23:11:06 +02:00
parent 6b97e7d9cb
commit ff7664bae0
2 changed files with 46 additions and 16 deletions

View File

@ -32,18 +32,19 @@ model Item {
}
model Zone {
id Int @id @default(autoincrement())
name String
width Int @default(10)
height Int @default(10)
tiles Json?
pvp Boolean @default(false)
zoneEventTiles ZoneEventTile[]
zoneObjects ZoneObject[]
characters Character[]
chats Chat[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
name String
width Int @default(10)
height Int @default(10)
tiles Json?
pvp Boolean @default(false)
zoneEventTiles ZoneEventTile[]
zoneEventTileTeleports ZoneEventTileTeleport[]
zoneObjects ZoneObject[]
characters Character[]
chats Chat[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ZoneObject {
@ -59,16 +60,27 @@ model ZoneObject {
enum ZoneEventTileType {
BLOCK
WARP
TELEPORT
NPC
ITEM
}
model ZoneEventTile {
id String @id @default(uuid())
id String @id @default(uuid())
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
type ZoneEventTileType
position_x Int
position_y Int
teleportId String? @unique
teleport ZoneEventTileTeleport? @relation("ZoneEventTileTeleport", fields: [teleportId], references: [id])
}
model ZoneEventTileTeleport {
id String @id @default(uuid())
zoneEventTile ZoneEventTile? @relation("ZoneEventTileTeleport")
toZoneId Int
toZone Zone @relation(fields: [toZoneId], references: [id], onDelete: Cascade)
toPosition_x Int
toPosition_y Int
}