Skip to content

Commit dc128ec

Browse files
committed
update db schema [ci skip]
all timestamps have fractional seconds with the precision 6 now. fractional seconds are unfortunately not default, for compatibility with previous MySQL versions (https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html)
1 parent c480cec commit dc128ec

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ We have successfully tested SteVe with charge points manufactured by EBG and Men
2626
SteVe requires
2727
* JDK 8 (both Oracle JDK and OpenJDK are supported)
2828
* Maven
29-
* MySQL database (MariaDB works as well)
29+
* At least MySQL 5.6.4 (MariaDB works as well) as database
30+
3031
to build and run.
3132

3233
SteVe is designed to run standalone, a java servlet container / web server (e.g. Apache Tomcat), is **not** required.

src/main/java/de/rwth/idsg/steve/utils/CustomDSL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public final class CustomDSL {
1414
private CustomDSL() { }
1515

1616
public static Field<DateTime> utcTimestamp() {
17-
return field("{utc_timestamp}", DateTime.class);
17+
return field("{utc_timestamp(6)}", DateTime.class);
1818
}
1919

2020
public static Field<DateTime> date(DateTime dt) {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--
2+
-- all timestamps have fractional seconds with the precision 6 now.
3+
-- fractional seconds are unfortunately not default, for compatibility with previous MySQL versions
4+
-- (https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html)
5+
--
6+
7+
ALTER TABLE `chargebox`
8+
CHANGE COLUMN `fwUpdateTimestamp` `fwUpdateTimestamp` TIMESTAMP(6) NULL DEFAULT NULL,
9+
CHANGE COLUMN `diagnosticsTimestamp` `diagnosticsTimestamp` TIMESTAMP(6) NULL DEFAULT NULL,
10+
CHANGE COLUMN `lastHeartbeatTimestamp` `lastHeartbeatTimestamp` TIMESTAMP(6) NULL DEFAULT NULL;
11+
12+
ALTER TABLE `connector_metervalue`
13+
CHANGE COLUMN `valueTimestamp` `valueTimestamp` TIMESTAMP(6) NULL DEFAULT NULL;
14+
15+
ALTER TABLE `connector_status`
16+
CHANGE COLUMN `statusTimestamp` `statusTimestamp` TIMESTAMP(6) NULL DEFAULT NULL;
17+
18+
ALTER TABLE `transaction`
19+
CHANGE COLUMN `startTimestamp` `startTimestamp` TIMESTAMP(6) NULL DEFAULT NULL,
20+
CHANGE COLUMN `stopTimestamp` `stopTimestamp` TIMESTAMP(6) NULL DEFAULT NULL;
21+
22+
ALTER TABLE `user`
23+
CHANGE COLUMN `expiryDate` `expiryDate` TIMESTAMP(6) NULL DEFAULT NULL;

0 commit comments

Comments
 (0)