81 lines
2.3 KiB
Plaintext
81 lines
2.3 KiB
Plaintext
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-py"
|
|
recursive_type_depth = 5
|
|
interface = "asyncio"
|
|
previewFeatures = ["fullTextSearch"]
|
|
partial_type_generator = "market/utils/partial_types.py"
|
|
}
|
|
|
|
enum SubmissionStatus {
|
|
PENDING
|
|
APPROVED
|
|
REJECTED
|
|
}
|
|
|
|
model Agents {
|
|
id String @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
version Int @default(1)
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
submissionDate DateTime @default(now())
|
|
submissionReviewDate DateTime?
|
|
submissionStatus SubmissionStatus @default(PENDING)
|
|
submissionReviewComments String?
|
|
|
|
name String?
|
|
description String?
|
|
author String?
|
|
|
|
keywords String[]
|
|
categories String[]
|
|
search Unsupported("tsvector")? @default(dbgenerated("''::tsvector"))
|
|
|
|
graph Json
|
|
AnalyticsTracker AnalyticsTracker[]
|
|
FeaturedAgent FeaturedAgent?
|
|
InstallTracker InstallTracker[]
|
|
|
|
@@id(name: "graphVersionId", [id, version])
|
|
}
|
|
|
|
model AnalyticsTracker {
|
|
id String @id @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
agentId String @unique @db.Uuid
|
|
agent Agents @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
views Int
|
|
downloads Int
|
|
}
|
|
|
|
enum InstallationLocation {
|
|
LOCAL
|
|
CLOUD
|
|
}
|
|
|
|
model InstallTracker {
|
|
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
marketplaceAgentId String @db.Uuid
|
|
marketplaceAgent Agents @relation(fields: [marketplaceAgentId], references: [id], onDelete: Cascade)
|
|
installedAgentId String @db.Uuid
|
|
installationLocation InstallationLocation
|
|
createdAt DateTime @default(now())
|
|
|
|
@@unique([marketplaceAgentId, installedAgentId])
|
|
}
|
|
|
|
model FeaturedAgent {
|
|
id String @id @unique @default(dbgenerated("gen_random_uuid()")) @db.Uuid
|
|
agentId String @unique @db.Uuid
|
|
agent Agents @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
isActive Boolean @default(false)
|
|
featuredCategories String[]
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|