mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2026-03-03 02:57:01 +00:00
docs(AGENTS.md): Add guidelines for AI coding agents working on the project
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN IF NOT EXISTS "verified" BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
-- CreateEnum (if not exists)
|
||||
DO $$ BEGIN
|
||||
CREATE TYPE "ReportReason" AS ENUM ('SPAM', 'INAPPROPRIATE', 'COPYRIGHT', 'MISLEADING', 'OTHER');
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
-- CreateEnum (if not exists)
|
||||
DO $$ BEGIN
|
||||
CREATE TYPE "ReportStatus" AS ENUM ('PENDING', 'REVIEWED', 'DISMISSED');
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
-- CreateTable (if not exists)
|
||||
CREATE TABLE IF NOT EXISTS "prompt_reports" (
|
||||
"id" TEXT NOT NULL,
|
||||
"reason" "ReportReason" NOT NULL,
|
||||
"details" TEXT,
|
||||
"status" "ReportStatus" NOT NULL DEFAULT 'PENDING',
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"promptId" TEXT NOT NULL,
|
||||
"reporterId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "prompt_reports_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "prompt_reports_promptId_idx" ON "prompt_reports"("promptId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "prompt_reports_reporterId_idx" ON "prompt_reports"("reporterId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "prompt_reports_status_idx" ON "prompt_reports"("status");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "prompt_reports" ADD CONSTRAINT "prompt_reports_promptId_fkey" FOREIGN KEY ("promptId") REFERENCES "prompts"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "prompt_reports" ADD CONSTRAINT "prompt_reports_reporterId_fkey" FOREIGN KEY ("reporterId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -43,6 +43,7 @@ model User {
|
||||
subscriptions CategorySubscription[]
|
||||
votes PromptVote[]
|
||||
pinnedPrompts PinnedPrompt[]
|
||||
reports PromptReport[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
@@ -153,6 +154,7 @@ model Prompt {
|
||||
votes PromptVote[]
|
||||
contributors User[] @relation("PromptContributors")
|
||||
pinnedBy PinnedPrompt[]
|
||||
reports PromptReport[]
|
||||
|
||||
@@index([authorId])
|
||||
@@index([categoryId])
|
||||
@@ -295,6 +297,44 @@ model PinnedPrompt {
|
||||
@@map("pinned_prompts")
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Prompt Reports
|
||||
// ============================================
|
||||
|
||||
enum ReportReason {
|
||||
SPAM
|
||||
INAPPROPRIATE
|
||||
COPYRIGHT
|
||||
MISLEADING
|
||||
OTHER
|
||||
}
|
||||
|
||||
enum ReportStatus {
|
||||
PENDING
|
||||
REVIEWED
|
||||
DISMISSED
|
||||
}
|
||||
|
||||
model PromptReport {
|
||||
id String @id @default(cuid())
|
||||
reason ReportReason
|
||||
details String? @db.Text
|
||||
status ReportStatus @default(PENDING)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
// Relations
|
||||
promptId String
|
||||
prompt Prompt @relation(fields: [promptId], references: [id], onDelete: Cascade)
|
||||
reporterId String
|
||||
reporter User @relation(fields: [reporterId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([promptId])
|
||||
@@index([reporterId])
|
||||
@@index([status])
|
||||
@@map("prompt_reports")
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// Webhook Integration
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user