From 6c17f85d04b224ff2a09265918765c9f4fc8cf94 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 10 May 2017 13:27:49 +0500 Subject: Implement computed attributes --- setup/default.xml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'setup') diff --git a/setup/default.xml b/setup/default.xml index 82f2798dd..0e43b210f 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -18,6 +18,7 @@ ./logs/tracker-server.log true + true @@ -364,6 +365,65 @@ DELETE FROM user_user WHERE userId = :userId AND managedUserId = :managedUserId + + SELECT * FROM attributes + + + + INSERT INTO attributes (description, type, attribute, expression) + VALUES (:description, :type, :attribute, :expression) + + + + UPDATE attributes SET + description = :description, + type = :type, + attribute = :attribute, + expression = :expression + WHERE id = :id + + + + DELETE FROM attributes WHERE id = :id + + + + SELECT userId, attributeId FROM user_attribute + + + + INSERT INTO user_attribute (userId, attributeId) VALUES (:userId, :attributeId) + + + + DELETE FROM user_attribute WHERE userId = :userId AND attributeId = :attributeId + + + + SELECT groupId, attributeId FROM group_attribute + + + + INSERT INTO group_attribute (groupId, attributeId) VALUES (:groupId, :attributeId) + + + + DELETE FROM group_attribute WHERE groupId = :groupId AND attributeId = :attributeId + + + + SELECT deviceId, attributeId FROM device_attribute + + + + INSERT INTO device_attribute (deviceId, attributeId) VALUES (:deviceId, :attributeId) + + + + DELETE FROM device_attribute WHERE deviceId = :deviceId AND attributeId = :attributeId + + + 5001 -- cgit v1.2.3