diff --git a/plexpy/__init__.py b/plexpy/__init__.py index bf47f57b..8a5abf38 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -758,7 +758,7 @@ def dbcheck(): 'CREATE TABLE IF NOT EXISTS notify_log (id INTEGER PRIMARY KEY AUTOINCREMENT, timestamp INTEGER, ' 'session_key INTEGER, rating_key INTEGER, parent_rating_key INTEGER, grandparent_rating_key INTEGER, ' 'user_id INTEGER, user TEXT, notifier_id INTEGER, agent_id INTEGER, agent_name TEXT, notify_action TEXT, ' - 'subject_text TEXT, body_text TEXT, script_args TEXT, success INTEGER DEFAULT 0)' + 'subject_text TEXT, body_text TEXT, script_args TEXT, success INTEGER DEFAULT 0, tag TEXT)' ) # newsletters table :: This table keeps record of the newsletter settings @@ -1964,6 +1964,15 @@ def dbcheck(): 'UPDATE notify_log SET success = 1' ) + # Upgrade notify_log table from earlier versions + try: + c_db.execute('SELECT tag FROM notify_log') + except sqlite3.OperationalError: + logger.debug("Altering database. Updating database table notify_log.") + c_db.execute( + 'ALTER TABLE notify_log ADD COLUMN tag TEXT' + ) + # Upgrade newsletter_log table from earlier versions try: c_db.execute('SELECT start_time FROM newsletter_log')