mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 02:43:49 +08:00
13 lines
542 B
SQL
13 lines
542 B
SQL
-- Knowledge Platform schema migration
|
|
-- Migration id: 0048_deletion_active_scope_indexes
|
|
-- Dialect: postgres
|
|
-- Keeps active deletion admission proportional to live fences instead of permanent audit history.
|
|
|
|
CREATE INDEX IF NOT EXISTS "deletion_jobs_active_scope_idx"
|
|
ON "deletion_jobs" ("tenant_id", "knowledge_space_id", "target_type", "target_id")
|
|
WHERE "active_slot" = 1;
|
|
|
|
CREATE INDEX IF NOT EXISTS "deletion_tombstones_active_scope_idx"
|
|
ON "deletion_tombstones" ("tenant_id", "knowledge_space_id")
|
|
WHERE "state" = 'active';
|