Rename event time field

This commit is contained in:
Anton Tananaev 2021-03-07 22:42:47 -08:00
parent 312cd7bd40
commit e28ae518fd
6 changed files with 24 additions and 8 deletions

15
schema/changelog-4.13.xml Normal file
View File

@ -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>

View File

@ -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>

View File

@ -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'>

View File

@ -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;

View File

@ -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;

Binary file not shown.