DB updates, removed all CRUD func's from repositories as prisma's func's are sufficient and reduces boilerplate.

This commit is contained in:
2024-07-22 02:16:35 +02:00
parent 6131a8455a
commit 34d6aa3d1b
23 changed files with 196 additions and 217 deletions

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `Character` MODIFY `position_x` INTEGER NOT NULL DEFAULT 0,
MODIFY `position_y` INTEGER NOT NULL DEFAULT 0,
MODIFY `rotation` INTEGER NOT NULL DEFAULT 0,
MODIFY `zoneId` INTEGER NOT NULL DEFAULT 1;

View File

@ -0,0 +1,12 @@
-- AlterTable
ALTER TABLE `Item` MODIFY `description` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `Zone` MODIFY `width` INTEGER NOT NULL DEFAULT 10,
MODIFY `height` INTEGER NOT NULL DEFAULT 10,
MODIFY `tiles` JSON NULL;
-- AlterTable
ALTER TABLE `ZoneObject` MODIFY `depth` INTEGER NOT NULL DEFAULT 0,
MODIFY `position_x` INTEGER NOT NULL DEFAULT 0,
MODIFY `position_y` INTEGER NOT NULL DEFAULT 0;

View File

@ -59,7 +59,7 @@ model Object {
model Item {
id String @id @default(uuid())
name String
description String
description String?
stackable Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@ -83,10 +83,10 @@ model Character {
level Int @default(1)
experience Int @default(0)
role String @default("player")
position_x Int
position_y Int
rotation Int
zoneId Int
position_x Int @default(0)
position_y Int @default(0)
rotation Int @default(0)
zoneId Int @default(1)
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
chats Chat[]
items CharacterItem[]
@ -104,9 +104,9 @@ model CharacterItem {
model Zone {
id Int @id @default(autoincrement())
name String
width Int
height Int
tiles Json
width Int @default(10)
height Int @default(10)
tiles Json?
pvp Boolean @default(false)
zoneEventTiles ZoneEventTile[]
zoneObjects ZoneObject[]
@ -122,9 +122,9 @@ model ZoneObject {
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
objectId String
object Object @relation(fields: [objectId], references: [id], onDelete: Cascade)
depth Int
position_x Int
position_y Int
depth Int @default(0)
position_x Int @default(0)
position_y Int @default(0)
}
enum ZoneEventTileType {