1
0
forked from noxious/server

Allow decimal values

This commit is contained in:
Dennis Postma 2024-07-06 22:34:18 +02:00
parent 73b0640637
commit 3c82f4f06b
2 changed files with 13 additions and 13 deletions

View File

@ -2,8 +2,8 @@
CREATE TABLE `Object` ( CREATE TABLE `Object` (
`id` VARCHAR(191) NOT NULL, `id` VARCHAR(191) NOT NULL,
`name` VARCHAR(191) NOT NULL, `name` VARCHAR(191) NOT NULL,
`origin_x` INTEGER NOT NULL DEFAULT 0, `origin_x` DECIMAL(65, 30) NOT NULL DEFAULT 0,
`origin_y` INTEGER NOT NULL DEFAULT 0, `origin_y` DECIMAL(65, 30) NOT NULL DEFAULT 0,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updatedAt` DATETIME(3) NOT NULL, `updatedAt` DATETIME(3) NOT NULL,

View File

@ -20,13 +20,13 @@ datasource db {
} }
model Object { model Object {
id String @id @default(uuid()) id String @id @default(uuid())
name String name String
origin_x Int @default(0) origin_x Decimal @default(0)
origin_y Int @default(0) origin_y Decimal @default(0)
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
ZoneObject ZoneObject[] ZoneObject ZoneObject[]
} }
model Item { model Item {
@ -75,8 +75,8 @@ model CharacterItem {
} }
model TileTag { model TileTag {
tile String @id tile String @id
tags Json tags Json
} }
model Zone { model Zone {
@ -94,9 +94,9 @@ model Zone {
} }
model ZoneObject { model ZoneObject {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
zoneId Int zoneId Int
zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade) zone Zone @relation(fields: [zoneId], references: [id], onDelete: Cascade)
objectId String objectId String
object Object @relation(fields: [objectId], references: [id]) object Object @relation(fields: [objectId], references: [id])
position_x Int position_x Int