diff options
Diffstat (limited to 'setup/unix')
-rw-r--r-- | setup/unix/traccar.xml | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/setup/unix/traccar.xml b/setup/unix/traccar.xml index 70270b7d1..eb4321bd2 100644 --- a/setup/unix/traccar.xml +++ b/setup/unix/traccar.xml @@ -43,8 +43,8 @@ language VARCHAR(128), distanceUnit VARCHAR(128), speedUnit VARCHAR(128), - latitude FLOAT DEFAULT 0 NOT NULL, - longitude FLOAT DEFAULT 0 NOT NULL, + latitude DOUBLE PRECISION DEFAULT 0 NOT NULL, + longitude DOUBLE PRECISION DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL); CREATE TABLE device ( @@ -53,8 +53,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, @@ -74,47 +73,34 @@ deviceTime TIMESTAMP NOT NULL, fixTime TIMESTAMP NOT NULL, valid BIT NOT NULL, - latitude FLOAT NOT NULL, - longitude FLOAT NOT NULL, + latitude DOUBLE PRECISION NOT NULL, + longitude DOUBLE PRECISION NOT NULL, altitude FLOAT NOT NULL, speed FLOAT NOT NULL, course FLOAT NOT NULL, address VARCHAR(512), - other VARCHAR(4096) NOT NULL, - FOREIGN KEY (deviceId) REFERENCES device (id) ON DELETE CASCADE); - - 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, - other VARCHAR(4096) NOT NULL, + attributes VARCHAR(4096) NOT NULL, FOREIGN KEY (deviceId) REFERENCES device (id) ON DELETE CASCADE); - ALTER TABLE device ADD - FOREIGN KEY (positionId) REFERENCES position (id) ON DELETE CASCADE; - - ALTER TABLE device ADD - FOREIGN KEY (dataId) REFERENCES data (id) ON DELETE CASCADE; + CREATE INDEX position_deviceId_fixTime ON position (deviceId, fixTime); CREATE TABLE server ( id INT PRIMARY KEY AUTO_INCREMENT, registration BIT NOT NULL, map VARCHAR(128), + bingKey VARCHAR(128), + mapUrl VARCHAR(128), language VARCHAR(128), distanceUnit VARCHAR(128), speedUnit VARCHAR(128), - latitude FLOAT DEFAULT 0 NOT NULL, - longitude FLOAT DEFAULT 0 NOT NULL, + latitude DOUBLE PRECISION DEFAULT 0 NOT NULL, + longitude DOUBLE PRECISION DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL); CREATE TABLE traccar ( version INT DEFAULT 0 NOT NULL); - INSERT INTO traccar (version) VALUES (301); + INSERT INTO traccar (version) VALUES (302); </entry> <entry key='database.selectServers'> @@ -130,6 +116,8 @@ UPDATE server SET registration = :registration, map = :map, + bingKey = :bingKey, + mapUrl = :mapUrl, language = :language, distanceUnit = :distanceUnit, speedUnit = :speedUnit, @@ -176,7 +164,7 @@ <entry key='database.updateUserPassword'> UPDATE "user" SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id; </entry> - + <entry key='database.deleteUser'> DELETE FROM "user" WHERE id = :id; </entry> @@ -184,38 +172,42 @@ <entry key='database.getPermissionsAll'> SELECT userId, deviceId FROM user_device; </entry> - + <entry key='database.selectDevicesAll'> SELECT * FROM device; </entry> - + <entry key='database.selectDevices'> SELECT * FROM device d INNER JOIN user_device ud ON d.id = ud.deviceId WHERE ud.userId = :userId; </entry> - + <entry key='database.insertDevice'> INSERT INTO device (name, uniqueId) VALUES (:name, :uniqueId); </entry> - + <entry key='database.updateDevice'> UPDATE device SET name = :name, uniqueId = :uniqueId WHERE id = :id; </entry> - + <entry key='database.deleteDevice'> DELETE FROM device WHERE id = :id; </entry> - + <entry key='database.linkDevice'> INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId); </entry> + <entry key='database.unlinkDevice'> + DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId; + </entry> + <entry key='database.selectPositions'> - SELECT * FROM position WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to; + SELECT * FROM position WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime; </entry> <entry key='database.insertPosition'> - INSERT INTO position (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, other) - VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :other); + INSERT INTO position (deviceId, protocol, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, attributes) + VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes); </entry> <entry key='database.selectLatestPositions'> @@ -238,12 +230,12 @@ <entry key='totem.port'>5007</entry> <entry key='enfora.port'>5008</entry> <entry key='meiligao.port'>5009</entry> - <entry key='maxon.port'>5010</entry> + <entry key='trv.port'>5010</entry> <entry key='suntech.port'>5011</entry> <entry key='progress.port'>5012</entry> <entry key='h02.port'>5013</entry> <entry key='jt600.port'>5014</entry> - <entry key='ev603.port'>5015</entry> + <entry key='huabao.port'>5015</entry> <entry key='v680.port'>5016</entry> <entry key='pt502.port'>5017</entry> <entry key='tr20.port'>5018</entry> @@ -266,7 +258,7 @@ <entry key='ywt.port'>5035</entry> <entry key='tk102.port'>5036</entry> <entry key='intellitrac.port'>5037</entry> - <entry key='xt7.port'>5038</entry> + <entry key='gpsmta.port'>5038</entry> <entry key='wialon.port'>5039</entry> <entry key='carscop.port'>5040</entry> <entry key='apel.port'>5041</entry> @@ -317,5 +309,11 @@ <entry key='castel.port'>5086</entry> <entry key='mxt.port'>5087</entry> <entry key='cityeasy.port'>5088</entry> + <entry key='aquila.port'>5089</entry> + <entry key='flextrack.port'>5090</entry> + <entry key='blackkite.port'>5091</entry> + <entry key='adm.port'>5092</entry> + <entry key='watch.port'>5093</entry> + <entry key='t800x.port'>5094</entry> </properties> |