forked from noxious/server
improved zone manager
This commit is contained in:
@ -23,12 +23,19 @@ model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
position_x Int?
|
||||
position_y Int?
|
||||
rotation Int?
|
||||
zoneId Int? @unique
|
||||
zone Zone? @relation(fields: [zoneId], references: [id])
|
||||
chatlogs Chatlogs[]
|
||||
characters Character[]
|
||||
}
|
||||
|
||||
model Character {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
position_x Int
|
||||
position_y Int
|
||||
rotation Int
|
||||
userId Int
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id])
|
||||
}
|
||||
|
||||
model Zone {
|
||||
@ -37,15 +44,5 @@ model Zone {
|
||||
width Int
|
||||
height Int
|
||||
tiles Json
|
||||
users User[] // One-to-many relation: A map can have multiple users
|
||||
chatlogs Chatlogs[]
|
||||
}
|
||||
|
||||
model Chatlogs {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
message String
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
characters Character[]
|
||||
}
|
Reference in New Issue
Block a user