mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-18 23:41:17 -04:00
40 lines
1 KiB
Text
40 lines
1 KiB
Text
// 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 = "../node_modules/.prisma/client"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
username String @unique @db.VarChar(50)
|
|
email String @unique
|
|
password String
|
|
files File[]
|
|
}
|
|
|
|
model File {
|
|
id Int @id @default(autoincrement())
|
|
name String @db.VarChar(255)
|
|
url String
|
|
createdAt DateTime @default(now())
|
|
owner User? @relation(fields: [ownerId], references: [id])
|
|
ownerId Int?
|
|
folder Folder? @relation(fields: [folderId], references: [id])
|
|
folderId Int?
|
|
}
|
|
|
|
model Folder {
|
|
id Int @id @default(autoincrement())
|
|
name String @db.VarChar(255)
|
|
File File[]
|
|
}
|