diff options
author | Abyss777 <abyss@fox5.ru> | 2016-10-20 15:32:56 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-10-20 15:32:56 +0500 |
commit | f7a00616b14821203f89e63d9c887b3e98b9826e (patch) | |
tree | 574078027988b1c6225b64e3ac8c6816ddef2016 | |
parent | dd6170837ebcda6303410f741b14e162e2ff2a29 (diff) | |
download | trackermap-server-f7a00616b14821203f89e63d9c887b3e98b9826e.tar.gz trackermap-server-f7a00616b14821203f89e63d9c887b3e98b9826e.tar.bz2 trackermap-server-f7a00616b14821203f89e63d9c887b3e98b9826e.zip |
Extend device model with management info
-rw-r--r-- | debug.xml | 14 | ||||
-rw-r--r-- | schema/changelog-3.8.xml | 13 | ||||
-rw-r--r-- | src/org/traccar/model/Device.java | 40 |
3 files changed, 65 insertions, 2 deletions
@@ -168,11 +168,21 @@ </entry> <entry key='database.insertDevice'> - INSERT INTO devices (name, uniqueId, groupId, attributes) VALUES (:name, :uniqueId, :groupId, :attributes) + INSERT INTO devices (name, uniqueId, groupId, attributes, phone, model, contact, type) + VALUES (:name, :uniqueId, :groupId, :attributes, :phone, :model, :contact, :type) </entry> <entry key='database.updateDevice'> - UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId, attributes = :attributes WHERE id = :id + UPDATE devices SET + name = :name, + uniqueId = :uniqueId, + groupId = :groupId, + attributes = :attributes, + phone = :phone, + model = :model, + contact = :contact, + type = :type + WHERE id = :id </entry> <entry key='database.updateDeviceStatus'> diff --git a/schema/changelog-3.8.xml b/schema/changelog-3.8.xml index 7a2b1e4e0..dbf04df79 100644 --- a/schema/changelog-3.8.xml +++ b/schema/changelog-3.8.xml @@ -94,5 +94,18 @@ <modifyDataType tableName="groups" columnName="attributes" newDataType="VARCHAR(4000)" /> <modifyDataType tableName="server" columnName="attributes" newDataType="VARCHAR(4000)" /> + <addColumn tableName="devices"> + <column name="phone" type="VARCHAR(128)" /> + </addColumn> + <addColumn tableName="devices"> + <column name="model" type="VARCHAR(128)" /> + </addColumn> + <addColumn tableName="devices"> + <column name="contact" type="VARCHAR(512)" /> + </addColumn> + <addColumn tableName="devices"> + <column name="type" type="VARCHAR(128)" /> + </addColumn> + </changeSet> </databaseChangeLog> diff --git a/src/org/traccar/model/Device.java b/src/org/traccar/model/Device.java index e90742836..47b8fb2a6 100644 --- a/src/org/traccar/model/Device.java +++ b/src/org/traccar/model/Device.java @@ -101,4 +101,44 @@ public class Device extends Extensible { public void setGeofenceIds(List<Long> geofenceIds) { this.geofenceIds = geofenceIds; } + + private String phone; + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + private String model; + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + private String contact; + + public String getContact() { + return contact; + } + + public void setContact(String contact) { + this.contact = contact; + } + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } } |