From 43a64fc359f8acf08f97d70ebdb93dafa607dc08 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 13 Oct 2015 11:12:18 +1300 Subject: Remove data model and fix some issues --- debug.xml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'debug.xml') diff --git a/debug.xml b/debug.xml index 5192dcb8b..b5ff02981 100644 --- a/debug.xml +++ b/debug.xml @@ -73,8 +73,7 @@ uniqueId VARCHAR(128) NOT NULL UNIQUE, status VARCHAR(128), lastUpdate TIMESTAMP, - positionId INT, - dataId INT); + positionId INT); CREATE TABLE user_device ( userId INT NOT NULL, @@ -105,16 +104,6 @@ CREATE INDEX position_deviceId_fixTime ON position (deviceId, fixTime); - CREATE TABLE data ( - id INT PRIMARY KEY AUTO_INCREMENT, - protocol VARCHAR(128), - deviceId INT NOT NULL, - serverTime TIMESTAMP NOT NULL, - deviceTime TIMESTAMP NOT NULL, - type VARCHAR(128), - attributes VARCHAR(4096) NOT NULL, - FOREIGN KEY (deviceId) REFERENCES device (id) ON DELETE CASCADE); - CREATE TABLE server ( id INT PRIMARY KEY AUTO_INCREMENT, registration BIT NOT NULL, @@ -245,23 +234,6 @@ UPDATE device SET positionId = :id WHERE id = :deviceId; - - SELECT * FROM data WHERE deviceId = :deviceId AND deviceTime BETWEEN :from AND :to ORDER BY deviceTime; - - - - INSERT INTO data (deviceId, protocol, serverTime, deviceTime, type, attributes) - VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :type, :attributes); - - - - SELECT * FROM data WHERE id IN (SELECT dataId FROM device); - - - - UPDATE device SET dataId = :id WHERE id = :deviceId; - - -- cgit v1.2.3