- packages/queue: ioredis singleton + BullMQ Queue/Worker (prefix mcpedia:
on shared imrnes Redis :6379); apps/worker runs startWorker()
- @mcpedia/core: indexContentFile/runFullIndex (single indexing entry point
shared by script/worker/hook) + revision.service (list/get/restore)
- document_revisions table (migration 0002) — snapshots only on body change
- apps/api: POST /hooks/reindex + /hooks/index webhooks; tRPC revisions,
getRevision, restoreRevision, jobStatus, queueStatus
- apps/mcp: register MCP Resources mcpedia://docs{/,+slug/chunks/revisions}
({+slug} RFC6570 reserved expansion for slugs containing /)
- apps/mcp zod pinned to ^4 to match MCP SDK 1.30 compiled types
(resolves registerTool TS2589/ShapeOutput skew)
- scripts/enqueue.ts one-shot job enqueue helper; indexer refactored to runFullIndex
- PHASES.md/README/.env.example/docs updated
111 lines
2.7 KiB
JSON
111 lines
2.7 KiB
JSON
{
|
|
"id": "0002_document_revisions",
|
|
"prevId": "0001_document_chunks",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"document_revisions": {
|
|
"name": "document_revisions",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"document_id": {
|
|
"name": "document_id",
|
|
"type": "text",
|
|
"notNull": true
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "text",
|
|
"notNull": true
|
|
},
|
|
"revision_no": {
|
|
"name": "revision_no",
|
|
"type": "integer",
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "text",
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"notNull": true
|
|
},
|
|
"meta": {
|
|
"name": "meta",
|
|
"type": "jsonb",
|
|
"notNull": true
|
|
},
|
|
"reason": {
|
|
"name": "reason",
|
|
"type": "text",
|
|
"notNull": true,
|
|
"default": "'index'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"document_revisions_document_id_idx": {
|
|
"name": "document_revisions_document_id_idx",
|
|
"columns": [
|
|
{ "name": "document_id", "asc": true }
|
|
],
|
|
"isUnique": false
|
|
},
|
|
"document_revisions_slug_idx": {
|
|
"name": "document_revisions_slug_idx",
|
|
"columns": [
|
|
{ "name": "slug", "asc": true }
|
|
],
|
|
"isUnique": false
|
|
},
|
|
"document_revisions_doc_rev_idx": {
|
|
"name": "document_revisions_doc_rev_idx",
|
|
"columns": [
|
|
{ "name": "document_id", "asc": true },
|
|
{ "name": "revision_no", "asc": false }
|
|
],
|
|
"isUnique": false
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"document_revisions_document_id_documents_id_fk": {
|
|
"name": "document_revisions_document_id_documents_id_fk",
|
|
"columns": ["document_id"],
|
|
"referenceTable": "documents",
|
|
"referenceColumns": ["id"],
|
|
"onDelete": "cascade"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {}
|
|
}
|
|
},
|
|
"enums": {},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"extensions": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
}
|