Files
team/server/channels/db/migrations/mysql/000136_create_attribute_view.up.sql
4a5e5b4d87 [MM-61756] Attribute Based Access Control - Phase 1 (#30785)
Attribute Based Access Control - Base
* MM-63662

* MM-63919

* MM-63954

* MM-63955 

* MM-63425

* MM-63426

* MM-63458

* MM-63459

* MM-63603

* MM-63845

* MM-64146

* MM-64199

* MM-64201

* MM-64233

* MM-64247

* MM-64268

---------

Co-authored-by: Harshil Sharma <[email protected]>
Co-authored-by: Pablo Andrés Vélez Vidal <[email protected]>
Co-authored-by: abhijit-singh <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
2025-05-15 11:33:08 +02:00

11 lines
288 B
SQL

CREATE OR REPLACE VIEW AttributeView AS
SELECT
pv.GroupID,
pv.TargetID,
pv.TargetType,
JSON_OBJECTAGG(pf.Name, pv.Value)
AS Attributes
FROM PropertyValues pv
LEFT JOIN PropertyFields pf ON pf.ID = pv.FieldID
GROUP BY GroupID, TargetID, TargetType;