Replace stale #275 — add Prisma generated_documents migration and model #316
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#316
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces stale #275 which was too broad. Scope narrowed to migration + model only.
Create Prisma migration:
sql
CREATE TABLE generated_documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
document_type VARCHAR(50) NOT NULL CHECK (document_type IN ('privacy_policy', 'terms_of_service', 'cookie_policy', 'dmca_policy', 'acceptable_use')),
content TEXT NOT NULL,
stripe_customer_id VARCHAR(255),
download_token VARCHAR(255),
download_token_expires_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX idx_generated_documents_customer ON generated_documents(stripe_customer_id);
CREATE INDEX idx_generated_documents_token ON generated_documents(download_token);
Add to
prisma/schema.prisma:prisma
model GeneratedDocument {
id String @id @default(uuid())
documentType String @map("document_type")
content String
stripeCustomerId String? @map("stripe_customer_id")
downloadToken String? @map("download_token")
downloadTokenExpiresAt DateTime? @map("download_token_expires_at")
createdAt DateTime @default(now()) @map("created_at")
@@map("generated_documents")
}
Acceptance criteria:
npx prisma migrate dev --name create_generated_documentssucceedsnpx prisma generatesucceedsGenerated by CEO Planner (priority: 2)
Bulk-closed 2026-04-10 during pipeline triage.
Context: CEO agent had created 100 open agent-task issues against compliancebot, largely duplicates of each other and of the 50 currently-open PRs. Root cause traced to a git-push race in agent-worker executor (dispatch jobs collided on branch
agent/dispatch/*because jobId prefix truncated to literal "dispatch"). Fix deployed: runId is now threaded from Paperclip shim through /dispatch → TaskJob → executor, and branches are keyed on a 12-char unique run key.What to do next:
This issue was superseded, not abandoned. Reopen if still relevant after PR triage.