From ba8779f8230c5adf4fa0a83be3272db9927b709f Mon Sep 17 00:00:00 2001 From: Leandro Silva Ferreira Date: Tue, 7 Aug 2012 12:32:35 -0400 Subject: Added windows config for PostGree SQL 9.1 and Mode Parameter (Idle mode,Parking,Active Mode (Driving)) in Position. --- setup/windows/windowsPG.cfg | 150 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 setup/windows/windowsPG.cfg (limited to 'setup') diff --git a/setup/windows/windowsPG.cfg b/setup/windows/windowsPG.cfg new file mode 100644 index 000000000..5a23d1e40 --- /dev/null +++ b/setup/windows/windowsPG.cfg @@ -0,0 +1,150 @@ + + + + + + + + org.postgresql.Driver + jdbc:postgresql:traccar + postgres + postgres + + + 300 + + + + CREATE SEQUENCE devicesSQ START 1 INCREMENT 1; + CREATE SEQUENCE positionsSQ START 1 INCREMENT 1; + CREATE TABLE devices (id int8 NOT NULL,imei varchar(16) NOT NULL,phonenumber varchar(255),uniqueid varchar(255),CONSTRAINT devices_pkey PRIMARY KEY (id)) WITH (OIDS=FALSE); + ALTER TABLE devices OWNER TO postgres; + CREATE TABLE positions (id int8 NOT NULL,address varchar(255),altitude float8,course float8,extendedinfo varchar(255),latitude float8 NOT NULL,longitude float8 NOT NULL,power float8 NOT NULL,speed float8,"time" timestamp NOT NULL,"valid" bool,device_id int8 NOT NULL,"mode" int4,CONSTRAINT positions_pkey PRIMARY KEY (id),CONSTRAINT fk_device FOREIGN KEY (device_id) REFERENCES devices (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION) WITH (OIDS=FALSE); + ALTER TABLE positions OWNER TO postgres; + + + + id - Long + imei - String + <--> + + SELECT id, imei + FROM devices + + + + imei - String + <--> + + INSERT INTO devices (id,imei) + VALUES (nextval('devicesSQ'),:imei) + + + + id - Long + imei - String + <--> + + UPDATE devices + SET imei = :imei + WHERE id = :id + + + + id - Long + <--> + + DELETE FROM devices + WHERE id = :id + + + + device_id - Long + <--> + + SELECT * + FROM positions + WHERE device_id = :device_id + + + + device_id - Long + time - Date + valid - Boolean + latitude - Double + longitude - Double + speed - Double + course - Double + power - Double (NULL for some protocols) + mode - Integer + extended_info - String (XML) + <--> + + INSERT INTO positions (id, device_id, time, valid, latitude, longitude, speed, course, power, mode) + VALUES (nextval('positionsSQ'),:device_id, :time, :valid, :latitude, :longitude, :speed, :course, :power, :mode) + + + + true + 8082 + + + false + jornadaLOG + + + false + 5000 + 0 + + + false + 5001 + 0 + + + false + 5002 + 0 + + + false + 5003 + 0 + + + false + 5004 + 0 + + + false + 5005 + 0 + + + false + 5006 + 0 + + + false + 5007 + 0 + + + false + 5008 + 0 + + + false + 5009 + 0 + + + true + 8801 + 0 + + -- cgit v1.2.3