org.h2.Driver jdbc:h2:./target/database sa true CREATE TABLE user ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(1024) NOT NULL, email VARCHAR(1024) NOT NULL UNIQUE, password VARCHAR(1024) NOT NULL, salt VARCHAR(1024) NOT NULL, readonly BOOLEAN DEFAULT false NOT NULL, admin BOOLEAN DEFAULT false NOT NULL, map VARCHAR(1024) DEFAULT 'osm' NOT NULL, language VARCHAR(1024) DEFAULT 'en' NOT NULL, distanceUnit VARCHAR(1024) DEFAULT 'km' NOT NULL, speedUnit VARCHAR(1024) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL); CREATE TABLE device ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(1024) NOT NULL, uniqueId VARCHAR(1024) NOT NULL UNIQUE, status VARCHAR(1024), lastUpdate TIMESTAMP, positionId INT, dataId INT); CREATE TABLE user_device ( userId INT NOT NULL, deviceId INT NOT NULL, read BOOLEAN DEFAULT true NOT NULL, write BOOLEAN DEFAULT true NOT NULL, FOREIGN KEY (userId) REFERENCES user(id) ON DELETE CASCADE, FOREIGN KEY (deviceId) REFERENCES device(id) ON DELETE CASCADE); CREATE INDEX user_device_user_id ON user_device(userId); CREATE TABLE position ( id INT PRIMARY KEY AUTO_INCREMENT, protocol VARCHAR(1024), deviceId INT NOT NULL, serverTime TIMESTAMP NOT NULL, deviceTime TIMESTAMP NOT NULL, fixTime TIMESTAMP NOT NULL, valid BOOLEAN NOT NULL, latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, altitude DOUBLE NOT NULL, speed DOUBLE NOT NULL, course DOUBLE NOT NULL, address VARCHAR(1024), other VARCHAR(8192) NOT NULL, FOREIGN KEY (deviceId) REFERENCES device(id) ON DELETE CASCADE); CREATE TABLE data ( id INT PRIMARY KEY AUTO_INCREMENT, protocol VARCHAR(1024), deviceId INT NOT NULL, serverTime TIMESTAMP NOT NULL, deviceTime TIMESTAMP NOT NULL, other VARCHAR(8192) NOT NULL, FOREIGN KEY (deviceId) REFERENCES device(id)); ALTER TABLE device ADD FOREIGN KEY (positionId) REFERENCES position(id); ALTER TABLE device ADD FOREIGN KEY (dataId) REFERENCES data(id); CREATE TABLE server ( id INT PRIMARY KEY AUTO_INCREMENT, registration BOOLEAN NOT NULL, latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, zoom INT NOT NULL); CREATE TABLE traccar1 ( id INT PRIMARY KEY AUTO_INCREMENT); SELECT * FROM device; INSERT INTO position (deviceId, serverTime, deviceTime, fixTime, valid, latitude, longitude, altitude, speed, course, address, other) VALUES (:deviceId, NOW(), :time, :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :other); UPDATE device SET positionId = :id WHERE id = :deviceId; true 8082 ../traccar-web/traccar-web.war true web webm false nominatim http://nominatim.openstreetmap.org/reverse true all target/tracker-server.log true 5000 true 5001 true 5002 true 5003 true 5004 true 5005 true 5006 false true 5007 true 5008 true 5009 true 5010 true 5011 true 5012 true 5013 true 5014 true 5015 true 5016 true 5017 true 5018 true 5019 true 5020 true 5021 true 5022 true 5023 true 5024 true 5025 true 5026 true 5027 true 5028 true 5029 true 5030 true 5031 true 5032 true 5033 true 5034 true 5035 true 5036 true 5037 true 5038 true 5039 true 5040 true 5041 true 5042 true 5043 true 5044 true 5045 true 5046 true 5047 true 5048 true 5049 false true 5050 true 5051 true 5052 true 5053 true 5054 true 5055 true 5056 true 5057 true 5058 true 5059 true 5060 true 5061 true 5062 true 5063 true 5064 true 5065 true 5066 true 5067 true 5068 true 5069 true 5070 true 5071 true 5072 true 5073 true 5074 true 5075 true 5076 true 5077 true 5078 true 5079 true 5080 true 5081 true 5082 true 5083 true 5084 true 5085 true 5086