aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-03-07 22:42:47 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-03-07 22:42:47 -0800
commite28ae518fddc930dcb26d70a4456ee1b28fb0ecc (patch)
treeac8678771bb35156e5537fd13ecfc66950a5ad54
parent312cd7bd408c978392cacb6ef580288158361ce5 (diff)
downloadtraccar-server-e28ae518fddc930dcb26d70a4456ee1b28fb0ecc.tar.gz
traccar-server-e28ae518fddc930dcb26d70a4456ee1b28fb0ecc.tar.bz2
traccar-server-e28ae518fddc930dcb26d70a4456ee1b28fb0ecc.zip
Rename event time field
-rw-r--r--schema/changelog-4.13.xml15
-rw-r--r--schema/changelog-master.xml1
-rw-r--r--setup/default.xml2
-rw-r--r--src/main/java/org/traccar/database/NotificationManager.java2
-rw-r--r--src/main/java/org/traccar/model/Event.java12
-rw-r--r--templates/export/events.xlsxbin12607 -> 8763 bytes
6 files changed, 24 insertions, 8 deletions
diff --git a/schema/changelog-4.13.xml b/schema/changelog-4.13.xml
new file mode 100644
index 000000000..ead5c6c28
--- /dev/null
+++ b/schema/changelog-4.13.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
+ http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
+ logicalFilePath="changelog-4.13">
+
+ <changeSet author="author" id="changelog-4.13">
+
+ <renameColumn tableName="tc_events" columnDataType="TIMESTAMP" oldColumnName="servertime" newColumnName="eventtime" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml
index 7d4475df7..df54737a2 100644
--- a/schema/changelog-master.xml
+++ b/schema/changelog-master.xml
@@ -27,5 +27,6 @@
<include file="changelog-4.9.xml" relativeToChangelogFile="true" />
<include file="changelog-4.10.xml" relativeToChangelogFile="true" />
<include file="changelog-4.11.xml" relativeToChangelogFile="true" />
+ <include file="changelog-4.13.xml" relativeToChangelogFile="true" />
</databaseChangeLog>
diff --git a/setup/default.xml b/setup/default.xml
index eca6e56ff..b4e8d95e1 100644
--- a/setup/default.xml
+++ b/setup/default.xml
@@ -57,7 +57,7 @@
</entry>
<entry key='database.selectEvents'>
- SELECT * FROM tc_events WHERE deviceId = :deviceId AND serverTime BETWEEN :from AND :to ORDER BY serverTime
+ SELECT * FROM tc_events WHERE deviceId = :deviceId AND eventTime BETWEEN :from AND :to ORDER BY eventTime
</entry>
<entry key='database.selectStatistics'>
diff --git a/src/main/java/org/traccar/database/NotificationManager.java b/src/main/java/org/traccar/database/NotificationManager.java
index ccad192f6..c4fc48ebf 100644
--- a/src/main/java/org/traccar/database/NotificationManager.java
+++ b/src/main/java/org/traccar/database/NotificationManager.java
@@ -90,7 +90,7 @@ public class NotificationManager extends ExtendedObjectManager<Notification> {
usersToForward.add(userId);
}
final Set<String> notificators = new HashSet<>();
- for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getServerTime())) {
+ for (long notificationId : getEffectiveNotifications(userId, deviceId, event.getEventTime())) {
Notification notification = getById(notificationId);
if (getById(notificationId).getType().equals(event.getType())) {
boolean filter = false;
diff --git a/src/main/java/org/traccar/model/Event.java b/src/main/java/org/traccar/model/Event.java
index 5eee2a0a0..47b74811a 100644
--- a/src/main/java/org/traccar/model/Event.java
+++ b/src/main/java/org/traccar/model/Event.java
@@ -27,7 +27,7 @@ public class Event extends Message {
public Event(String type, long deviceId) {
setType(type);
setDeviceId(deviceId);
- this.serverTime = new Date();
+ this.eventTime = new Date();
}
public Event() {
@@ -62,14 +62,14 @@ public class Event extends Message {
public static final String TYPE_DRIVER_CHANGED = "driverChanged";
- private Date serverTime;
+ private Date eventTime;
- public Date getServerTime() {
- return serverTime;
+ public Date getEventTime() {
+ return eventTime;
}
- public void setServerTime(Date serverTime) {
- this.serverTime = serverTime;
+ public void setEventTime(Date eventTime) {
+ this.eventTime = eventTime;
}
private long positionId;
diff --git a/templates/export/events.xlsx b/templates/export/events.xlsx
index c658414b4..a6366750c 100644
--- a/templates/export/events.xlsx
+++ b/templates/export/events.xlsx
Binary files differ