Rework notify_log table to save each notification separately

This commit is contained in:
JonnyWong16 2016-02-21 15:44:21 -08:00
parent 3c6a6cdc5b
commit c93b65b299
3 changed files with 231 additions and 147 deletions

View file

@ -860,8 +860,9 @@ class DataFactory(object):
monitor_db = database.MonitorDatabase()
if rating_key:
query = 'SELECT id, poster_url FROM notify_log WHERE rating_key = %d ' \
'ORDER BY id DESC LIMIT 1' % int(rating_key)
query = 'SELECT id, poster_url FROM notify_log ' \
'WHERE rating_key = %d OR parent_rating_key = %d OR grandparent_rating_key = %d ' \
'ORDER BY id DESC LIMIT 1' % (int(rating_key), int(rating_key), int(rating_key))
result = monitor_db.select(query)
else:
return None