fix(ci): align B5 schema with tenant isolation
Some checks failed
CD Pipeline / tests (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
Code Review / ai-code-review (push) Has been cancelled

This commit is contained in:
Your Name
2026-05-05 15:00:07 +08:00
parent 72d66e4ae6
commit e24c8ea051

View File

@@ -109,6 +109,7 @@ CREATE TABLE IF NOT EXISTS ai_provider_version_history (
CREATE TABLE IF NOT EXISTS knowledge_entries (
id VARCHAR(36) PRIMARY KEY,
project_id VARCHAR(64) NOT NULL DEFAULT 'awoooi',
title VARCHAR NOT NULL,
content TEXT,
entry_type entrytype NOT NULL,
@@ -129,6 +130,11 @@ CREATE TABLE IF NOT EXISTS knowledge_entries (
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- 2026-05-05 AwoooP Phase 2 tenant isolation: align integration schema with KnowledgeEntryRecord.project_id.
ALTER TABLE knowledge_entries
ADD COLUMN IF NOT EXISTS project_id VARCHAR(64) NOT NULL DEFAULT 'awoooi';
CREATE INDEX IF NOT EXISTS ix_knowledge_entries_project_id
ON knowledge_entries(project_id);
-- M3 冪等 unique index (incident_id + path_type)
CREATE UNIQUE INDEX IF NOT EXISTS uix_knowledge_incident_path
ON knowledge_entries(related_incident_id, path_type)