chore: update project configuration by adding Prisma dependencies, generating Prisma client, and updating .gitignore; remove package-lock.json
This commit is contained in:
84
prisma/schema.prisma
Normal file
84
prisma/schema.prisma
Normal file
@@ -0,0 +1,84 @@
|
||||
// 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 User {
|
||||
id String @id @default(cuid())
|
||||
email String @unique
|
||||
name String?
|
||||
password String
|
||||
sessions Session[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
collaborator String
|
||||
date DateTime @default(now())
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
items SwotItem[]
|
||||
actions Action[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
enum SwotCategory {
|
||||
STRENGTH
|
||||
WEAKNESS
|
||||
OPPORTUNITY
|
||||
THREAT
|
||||
}
|
||||
|
||||
model SwotItem {
|
||||
id String @id @default(cuid())
|
||||
content String
|
||||
category SwotCategory
|
||||
order Int @default(0)
|
||||
sessionId String
|
||||
session Session @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
||||
actionLinks ActionLink[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([sessionId])
|
||||
}
|
||||
|
||||
model Action {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
description String?
|
||||
priority Int @default(0)
|
||||
status String @default("todo")
|
||||
dueDate DateTime?
|
||||
sessionId String
|
||||
session Session @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
||||
links ActionLink[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([sessionId])
|
||||
}
|
||||
|
||||
model ActionLink {
|
||||
id String @id @default(cuid())
|
||||
actionId String
|
||||
action Action @relation(fields: [actionId], references: [id], onDelete: Cascade)
|
||||
swotItemId String
|
||||
swotItem SwotItem @relation(fields: [swotItemId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([actionId, swotItemId])
|
||||
@@index([actionId])
|
||||
@@index([swotItemId])
|
||||
}
|
||||
Reference in New Issue
Block a user