1
0
forked from noxious/server

Zone updating stuff

This commit is contained in:
2024-07-10 17:31:07 +02:00
parent d001d3bd23
commit 45b4817ac4
4 changed files with 64 additions and 42 deletions

View File

@ -84,7 +84,7 @@ CREATE TABLE `Zone` (
-- CreateTable
CREATE TABLE `ZoneObject` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id` VARCHAR(191) NOT NULL,
`zoneId` INTEGER NOT NULL,
`objectId` VARCHAR(191) NOT NULL,
`depth` INTEGER NOT NULL,
@ -96,7 +96,7 @@ CREATE TABLE `ZoneObject` (
-- CreateTable
CREATE TABLE `ZoneEventTile` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id` VARCHAR(191) NOT NULL,
`zoneId` INTEGER NOT NULL,
`type` ENUM('BLOCK', 'WARP', 'NPC', 'ITEM') NOT NULL,
`position_x` INTEGER NOT NULL,

View File

@ -80,21 +80,21 @@ model TileTag {
}
model Zone {
id Int @id @default(autoincrement())
name String
width Int
height Int
tiles Json
id Int @id @default(autoincrement())
name String
width Int
height Int
tiles Json
zoneEventTiles ZoneEventTile[]
zoneObjects ZoneObject[]
characters Character[]
chats Chat[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
zoneObjects ZoneObject[]
characters Character[]
chats Chat[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ZoneObject {
id Int @id @default(autoincrement())
id String @id @default(uuid())
zoneId Int
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
objectId String
@ -112,9 +112,9 @@ enum ZoneEventTileType {
}
model ZoneEventTile {
id Int @id @default(autoincrement())
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