node-server/prisma/schema.prisma

82 lines
1.8 KiB
Plaintext

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
}
model User {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
username String @unique
password String
updates Update[]
Post Post[]
Product Product[]
}
model Product {
id String @id @default(uuid())
createdAt DateTime @default(now())
name String
belongsTo User @relation(fields: [belongsToId], references: [id])
belongsToId String
updates Update[]
}
enum UPDATE_STATUS {
IN_PROGRESS
LIVE
DEPRECATED
ARCHIVED
}
model Update {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime
title String @db.VarChar(255)
body String
status UPDATE_STATUS @default(IN_PROGRESS)
version String?
asset String
productId String
product Product @relation(fields: [productId], references: [id])
updatePoints UpdatePoint[]
User User[]
}
model UpdatePoint {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime
name String @db.VarChar(255)
description String
updateId String
update Update @relation(fields: [updateId], references: [id])
}