[H2] Use LocalDateTime in H2HistoryTrigger with microsecond precision - fix DbMigrationTest

This commit is contained in:
Rob Bygrave committed 2022-03-01 20:52:39 +13:00
1 parent 52aa1a2d91
commit 6d27e30b88
2 files changed
+8 -7

No files matched your search

@@ -5,6 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.*;
import java.time.LocalDateTime;
import java.util.Arrays;
/**
@@ -76,7 +77,7 @@ public class H2HistoryTrigger implements Trigger {
public void fire(Connection connection, Object[] oldRow, Object[] newRow) throws SQLException {
if (oldRow != null) {
// a delete or update event
Timestamp now = new Timestamp(System.currentTimeMillis());
LocalDateTime now = LocalDateTime.now();
oldRow[effectEndPosition] = now;
if (newRow != null) {
// update event. Set the effective start timestamp to now.