From 2f11883528f4bfb5210259f735531e216b40fb7d Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 12 Jul 2017 09:02:49 +0500 Subject: Add database requests --- setup/default.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'setup') diff --git a/setup/default.xml b/setup/default.xml index 2fc6c3cf0..9533c3a9b 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -431,6 +431,63 @@ DELETE FROM device_attribute WHERE deviceId = :deviceId AND attributeId = :attributeId + + SELECT * FROM drivers + + + + INSERT INTO drivers (name, uniqueId, attributes) + VALUES (:name, :uniqueId, :attributes) + + + + UPDATE drivers SET + name = :name, + uniqueId = :uniqueId + attributes = :attributes + WHERE id = :id + + + + DELETE FROM drivers WHERE id = :id + + + + SELECT userId, driverId FROM user_driver + + + + INSERT INTO user_driver (userId, driverId) VALUES (:userId, :driverId) + + + + DELETE FROM user_attribute WHERE userId = :userId AND driverId = :driverId + + + + SELECT groupId, driverId FROM group_driver + + + + INSERT INTO group_driver (groupId, driverId) VALUES (:groupId, :driverId) + + + + DELETE FROM group_driver WHERE groupId = :groupId AND driverId = :driverId + + + + SELECT deviceId, driverId FROM device_driver + + + + INSERT INTO device_driver (deviceId, driverId) VALUES (:deviceId, :driverId) + + + + DELETE FROM device_driver WHERE deviceId = :deviceId AND driverId = :driverId + + 5001 -- cgit v1.2.3