feat: expenses, report and day log commands
This commit is contained in:
39
prisma/schema.prisma
Normal file
39
prisma/schema.prisma
Normal file
@@ -0,0 +1,39 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
|
||||
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
|
||||
}
|
||||
|
||||
model Expense {
|
||||
id String @id @default(cuid())
|
||||
description String
|
||||
cost Float
|
||||
deleted Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
categoryId String
|
||||
category Category @relation(fields: [categoryId], references: [id])
|
||||
|
||||
@@index([categoryId])
|
||||
}
|
||||
|
||||
model Category {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
createdAt DateTime @default(now())
|
||||
expenses Expense[]
|
||||
}
|
||||
|
||||
model DayLog {
|
||||
id String @id @default(cuid())
|
||||
date DateTime @unique // When querying, ensure date is set to midnight UTC
|
||||
comments Json
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([date])
|
||||
}
|
||||
Reference in New Issue
Block a user