DB schema updates

This commit is contained in:
Leon Meier 2025-03-09 23:07:26 +01:00
parent 42f6e0b22d
commit fa7f3004fa

View File

@ -22,7 +22,7 @@ model user {
// TODO: Prüfen ob nötig, erstmal vorbereitet. // TODO: Prüfen ob nötig, erstmal vorbereitet.
transactions transactions[] transactions transactions[]
@@fulltext([name]) @@fulltext([name, email])
} }
model transactions { model transactions {
@ -33,9 +33,9 @@ model transactions {
user user @relation(fields: [userId], references: [id]) user user @relation(fields: [userId], references: [id])
userId Int userId Int
total Float total Decimal @db.Decimal(5,2)
paid Boolean @default(false) paid Boolean @default(false)
paidAt Boolean? paidAt DateTime?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
} }
@ -55,7 +55,7 @@ model products {
id Int @id @unique @default(autoincrement()) id Int @id @unique @default(autoincrement())
gtin String @unique // Dont try to use BigInt -> https://github.com/prisma/studio/issues/614 gtin String @unique // Dont try to use BigInt -> https://github.com/prisma/studio/issues/614
name String @unique name String @unique
price Decimal @db.Decimal(5,2) // FIXME: input: 77.80 -> output: 77.8 price Decimal @db.Decimal(5,2)
stock Int stock Int
visible Boolean @default(true) visible Boolean @default(true)