From d48beba307fc91c6ff1dfc6bac23fc70344d5719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 8 Feb 2020 22:49:23 +0100 Subject: [PATCH] [Notifications] Fix timetable notification not having subject name. --- .../pl/szczodrzynski/edziennik/data/db/dao/TimetableDao.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/TimetableDao.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/TimetableDao.kt index d942a209..57133bd0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/TimetableDao.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/dao/TimetableDao.kt @@ -120,11 +120,15 @@ interface TimetableDao { @Query(""" SELECT timetable.*, + subjects.subjectLongName AS subjectName, teachers.teacherName ||" "|| teachers.teacherSurname AS teacherName, + oldS.subjectLongName AS oldSubjectName, oldT.teacherName ||" "|| oldT.teacherSurname AS oldTeacherName, metadata.seen, metadata.notified, metadata.addedDate FROM timetable + LEFT JOIN subjects USING(profileId, subjectId) LEFT JOIN teachers USING(profileId, teacherId) + LEFT JOIN subjects AS oldS ON timetable.profileId = oldS.profileId AND timetable.oldSubjectId = oldS.subjectId LEFT JOIN teachers AS oldT ON timetable.profileId = oldT.profileId AND timetable.oldTeacherId = oldT.teacherId LEFT JOIN metadata ON id = thingId AND thingType = ${Metadata.TYPE_LESSON_CHANGE} AND metadata.profileId = timetable.profileId WHERE timetable.type NOT IN (${Lesson.TYPE_NORMAL}, ${Lesson.TYPE_NO_LESSONS}, ${Lesson.TYPE_SHIFTED_SOURCE}) AND metadata.notified = 0