Initial curated projectbrain source from 8a7b1e0651dbdab97d744cbd2e653ab3970ac6c5
This commit is contained in:
commit
5aa3e8d685
700 files changed
+132801
No files matched your search
@@ -0,0 +1,36 @@
|
||||
ALTER TYPE "EntityType" ADD VALUE IF NOT EXISTS 'documentation_item';
|
||||
|
||||
-- P8 Documentation / Knowledge / Memory persistence
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "DocumentationItem" (
|
||||
"id" TEXT NOT NULL,
|
||||
"projectId" TEXT NOT NULL,
|
||||
"slug" TEXT,
|
||||
"readableId" TEXT,
|
||||
"title" TEXT NOT NULL,
|
||||
"kind" TEXT NOT NULL,
|
||||
"status" TEXT NOT NULL,
|
||||
"approvalState" "ApprovalState" NOT NULL DEFAULT 'pending',
|
||||
"content" TEXT,
|
||||
"metadataJson" JSONB,
|
||||
"trustJson" JSONB,
|
||||
"provenanceJson" JSONB,
|
||||
"createdBy" TEXT NOT NULL DEFAULT 'system',
|
||||
"updatedBy" TEXT,
|
||||
"sourceType" TEXT NOT NULL DEFAULT 'fixture_seed',
|
||||
"archivedAt" TIMESTAMP(3),
|
||||
"deletedAt" TIMESTAMP(3),
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
CONSTRAINT "DocumentationItem_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "DocumentationItem_projectId_slug_key" ON "DocumentationItem"("projectId", "slug");
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "DocumentationItem_projectId_readableId_key" ON "DocumentationItem"("projectId", "readableId");
|
||||
CREATE INDEX IF NOT EXISTS "DocumentationItem_projectId_idx" ON "DocumentationItem"("projectId");
|
||||
CREATE INDEX IF NOT EXISTS "DocumentationItem_projectId_kind_idx" ON "DocumentationItem"("projectId", "kind");
|
||||
CREATE INDEX IF NOT EXISTS "DocumentationItem_projectId_status_idx" ON "DocumentationItem"("projectId", "status");
|
||||
CREATE INDEX IF NOT EXISTS "DocumentationItem_projectId_approvalState_idx" ON "DocumentationItem"("projectId", "approvalState");
|
||||
CREATE INDEX IF NOT EXISTS "DocumentationItem_projectId_deletedAt_idx" ON "DocumentationItem"("projectId", "deletedAt");
|
||||
|
||||
ALTER TABLE "DocumentationItem" ADD CONSTRAINT "DocumentationItem_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in new issue
Block a user