41 lines
977 B
Plaintext
41 lines
977 B
Plaintext
|
|
// This is your Prisma schema file,
|
||
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||
|
|
|
||
|
|
generator client {
|
||
|
|
provider = "prisma-client-js"
|
||
|
|
}
|
||
|
|
|
||
|
|
datasource db {
|
||
|
|
provider = "sqlite"
|
||
|
|
url = env("DATABASE_URL")
|
||
|
|
}
|
||
|
|
|
||
|
|
model Team {
|
||
|
|
id String @id
|
||
|
|
icon String
|
||
|
|
description String?
|
||
|
|
members User[]
|
||
|
|
}
|
||
|
|
|
||
|
|
model User {
|
||
|
|
id String @id @default(uuid())
|
||
|
|
createdAt DateTime @default(now())
|
||
|
|
updatedAt DateTime @updatedAt
|
||
|
|
username String @unique
|
||
|
|
icon String
|
||
|
|
passwordHash String
|
||
|
|
teamId String
|
||
|
|
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||
|
|
expenses Expense[]
|
||
|
|
}
|
||
|
|
|
||
|
|
model Expense {
|
||
|
|
id String @id @default(uuid())
|
||
|
|
userId String
|
||
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||
|
|
createdAt DateTime @default(now())
|
||
|
|
updatedAt DateTime @updatedAt
|
||
|
|
description String
|
||
|
|
amount Float
|
||
|
|
}
|