T11: tags plugin + permissions plugin + entity links backend — 68 tests, 66.61% coverage

This commit is contained in:
leocrm-bot
2026-06-29 14:01:24 +02:00
parent 700b7a71ad
commit 5d1850768a
26 changed files with 2863 additions and 7 deletions
@@ -0,0 +1,14 @@
-- Entity Links plugin initial migration: creates entity_links table
CREATE TABLE IF NOT EXISTS entity_links (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id UUID NOT NULL,
file_id UUID NOT NULL,
entity_type VARCHAR(20) NOT NULL,
entity_id UUID NOT NULL,
created_by UUID,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_entity_links_file_entity UNIQUE (tenant_id, file_id, entity_type, entity_id)
);
CREATE INDEX IF NOT EXISTS ix_entity_links_file ON entity_links(tenant_id, file_id);
CREATE INDEX IF NOT EXISTS ix_entity_links_entity ON entity_links(tenant_id, entity_type, entity_id);