code refractor
This commit is contained in:
@ -9,12 +9,37 @@ generator client {
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = "file:./dev.db"
|
||||
provider = "mysql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
position_x Int?
|
||||
position_y Int?
|
||||
rotation Int?
|
||||
mapId Int? @unique
|
||||
map Map? @relation(fields: [mapId], references: [id])
|
||||
chatlogs Chatlogs[]
|
||||
}
|
||||
|
||||
model Map {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
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
|
||||
mapId Int
|
||||
map Map @relation(fields: [mapId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
}
|
Reference in New Issue
Block a user