diff options
Diffstat (limited to 'default.cfg')
-rw-r--r-- | default.cfg | 68 |
1 files changed, 19 insertions, 49 deletions
diff --git a/default.cfg b/default.cfg index 6409637bb..8d4df93c7 100644 --- a/default.cfg +++ b/default.cfg @@ -14,59 +14,17 @@ <!-- Database refresh delay in seconds --> <entry key="database.refreshDelay">300</entry> - <!-- Create database schema --> - <entry key="database.initialize"> - CREATE TABLE IF NOT EXISTS devices (id INT IDENTITY, imei VARCHAR(16)); - CREATE TABLE IF NOT EXISTS positions (device_id INT, time TIMESTAMP, valid BOOLEAN, latitude DOUBLE, longitude DOUBLE, speed DOUBLE, course DOUBLE, power DOUBLE); - </entry> - <!--> - id - Integer + id - Long imei - String <--> <entry key="database.selectDevice"> - SELECT id, imei + SELECT id, uniqueId as imei FROM devices; </entry> <!--> - imei - String - <--> - <entry key="database.insertDevice"> - INSERT INTO devices (imei) - VALUES (:imei); - </entry> - - <!--> - id - Integer - imei - String - <--> - <entry key="database.updateDevice"> - UPDATE devices - SET imei = :imei - WHERE id = :id; - </entry> - - <!--> - id - Integer - <--> - <entry key="database.deleteDevice"> - DELETE FROM devices - WHERE id = :id; - </entry> - - <!--> - device_id - Integer - <--> - <entry key="database.selectPosition"> - SELECT * - FROM positions - WHERE device_id = :device_id - ORDER by time DESC; - </entry> - - <!--> - device_id - Integer + device_id - Long time - Date valid - Boolean latitude - Double @@ -76,16 +34,28 @@ power - Double (NULL for some protocols) extended_info - String (XML) <--> + <!--> + H2 - SCOPE_IDENTITY() + MySQL - LAST_INSERT_ID() + <--> <entry key="database.insertPosition"> - INSERT INTO positions (device_id, time, valid, latitude, longitude, speed, course, power) - VALUES (:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power); + INSERT INTO positions (device_id, time, valid, latitude, longitude, altitude, speed, course, power) + VALUES (:device_id, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :power); + </entry> + + <!--> + device_id - Long + id - Long + <--> + <entry key="database.updateLatestPosition"> + UPDATE devices SET latestPosition_id = :id WHERE id = :device_id; </entry> <!-- Web interface --> <entry key="http.enable">true</entry> <!--<entry key="http.address"></entry>--> <entry key="http.port">8082</entry> - <entry key="http.application">/home/user/Documents/traccar-web/target/traccar-web-1.0-SNAPSHOT.war</entry> + <entry key="http.application">/home/user/Documents/traccar-web/traccar-web.war</entry> <!-- Geocoder options --> <entry key="geocoder.enable">false</entry> @@ -190,5 +160,5 @@ <!-- GT06 server configuration --> <entry key="gt06.enable">true</entry> <entry key="gt06.port">5023</entry> - + </properties> |