worked on wall logics
This commit is contained in:
@ -29,7 +29,7 @@ model User {
|
||||
model Character {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
name String @unique
|
||||
hitpoints Int @default(100)
|
||||
mana Int @default(100)
|
||||
@ -40,26 +40,39 @@ model Character {
|
||||
position_y Int
|
||||
rotation Int
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id])
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
chats Chat[]
|
||||
}
|
||||
|
||||
model Zone {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
width Int
|
||||
height Int
|
||||
tiles Json
|
||||
characters Character[]
|
||||
chats Chat[]
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
width Int
|
||||
height Int
|
||||
tiles Json
|
||||
walls Json
|
||||
decorations ZoneDecoration[]
|
||||
characters Character[]
|
||||
chats Chat[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model ZoneDecoration {
|
||||
id Int @id @default(autoincrement())
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
type Int
|
||||
position_x Int
|
||||
position_y Int
|
||||
}
|
||||
|
||||
model Chat {
|
||||
id Int @id @default(autoincrement())
|
||||
characterId Int
|
||||
character Character @relation(fields: [characterId], references: [id])
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
zoneId Int
|
||||
zone Zone @relation(fields: [zoneId], references: [id])
|
||||
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
|
||||
message String
|
||||
createdAt DateTime
|
||||
}
|
||||
|
Reference in New Issue
Block a user