T11: tags plugin + permissions plugin + entity links backend — 68 tests, 66.61% coverage
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user