diff --git a/DatabaseSetup.sql b/DatabaseSetup.sql index bfbe701..16e55e2 100644 --- a/DatabaseSetup.sql +++ b/DatabaseSetup.sql @@ -21,4 +21,3 @@ CREATE TABLE IF NOT EXISTS events REFERENCES students (id) ON DELETE CASCADE ); - diff --git a/app/src/main/java/xyz/vallat/louis/managers/database/EventManager.java b/app/src/main/java/xyz/vallat/louis/managers/database/EventManager.java index 63a3e1b..0048c9c 100644 --- a/app/src/main/java/xyz/vallat/louis/managers/database/EventManager.java +++ b/app/src/main/java/xyz/vallat/louis/managers/database/EventManager.java @@ -85,7 +85,7 @@ public final class EventManager { public static List getNextEventsFromStudent(Student s) { logger.debug("Getting events from student '{}'.", s.getSnowflake()); String sql = "SELECT id, summary, start_event, end_event" + - " FROM events WHERE students_id = ? AND start_event >= NOW();"; + " FROM events WHERE students_id = ? AND (start_event + interval '5 minutes') >= NOW();"; List events = new ArrayList<>(); try (Connection connection = DBManager.getConnection()) { try (PreparedStatement stmt = connection.prepareStatement(sql)) {