mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
61 lines
1.4 KiB
Plaintext
61 lines
1.4 KiB
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"
|
|
previewFeatures = ["referentialIntegrity"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("PLANETSCALE_PRISMA_DATABASE_URL")
|
|
referentialIntegrity = "prisma"
|
|
}
|
|
|
|
model Users {
|
|
id String @id @default(uuid())
|
|
emil String
|
|
username String
|
|
password String
|
|
Tweets Tweets[]
|
|
Posts Posts[]
|
|
}
|
|
|
|
model Tweets {
|
|
id String @id @default(uuid())
|
|
content String
|
|
Users Users? @relation(fields: [usersId], references: [id])
|
|
usersId String?
|
|
createAt DateTime @default(now())
|
|
updateAt DateTime @updatedAt
|
|
}
|
|
|
|
model Posts {
|
|
id String @id @default(uuid())
|
|
Users Users? @relation(fields: [usersId], references: [id])
|
|
usersId String?
|
|
title String
|
|
date DateTime @default(now())
|
|
updateAt DateTime @updatedAt
|
|
tags Tags[]
|
|
categories Category? @relation(fields: [categoryId], references: [id])
|
|
url String
|
|
index_img String?
|
|
content String @db.LongText
|
|
desc String @db.VarChar(255)
|
|
file_name String @db.VarChar(255)
|
|
categoryId String
|
|
}
|
|
|
|
model Tags {
|
|
id String @id @default(uuid())
|
|
name String
|
|
Posts Posts[]
|
|
}
|
|
|
|
model Category {
|
|
id String @id @default(uuid())
|
|
name String
|
|
Posts Posts[]
|
|
}
|