Add Prisma integration with SQLite, update dependencies, and configure Svelte
This commit is contained in:
46
prisma/schema.prisma
Normal file
46
prisma/schema.prisma
Normal file
@@ -0,0 +1,46 @@
|
||||
// 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"
|
||||
}
|
||||
|
||||
model Year {
|
||||
year Int @id
|
||||
|
||||
people Person[]
|
||||
}
|
||||
|
||||
model Person {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
|
||||
yearId Int
|
||||
year Year @relation(fields: [yearId], references: [year])
|
||||
|
||||
gifts Gift[]
|
||||
}
|
||||
|
||||
model Gift {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
url String?
|
||||
description String?
|
||||
price Float?
|
||||
status GiftStatus @default(PLANNED)
|
||||
|
||||
personId Int
|
||||
person Person @relation(fields: [personId], references: [id])
|
||||
}
|
||||
|
||||
enum GiftStatus {
|
||||
PLANNED
|
||||
BUY
|
||||
BOUGHT
|
||||
WRAPPED
|
||||
GIVEN
|
||||
}
|
||||
Reference in New Issue
Block a user