mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Log newsletter start time and end time in database
This commit is contained in:
parent
dbe3b492fd
commit
eee759d0d0
2 changed files with 20 additions and 3 deletions
|
@ -648,7 +648,7 @@ def dbcheck():
|
|||
'CREATE TABLE IF NOT EXISTS newsletter_log (id INTEGER PRIMARY KEY AUTOINCREMENT, timestamp INTEGER, '
|
||||
'newsletter_id INTEGER, agent_id INTEGER, agent_name TEXT, notify_action TEXT, '
|
||||
'subject_text TEXT, body_text TEXT, message_text TEXT, start_date TEXT, end_date TEXT, '
|
||||
'uuid TEXT UNIQUE, success INTEGER DEFAULT 0)'
|
||||
'start_time INTEGER, end_time INTEGER, uuid TEXT UNIQUE, success INTEGER DEFAULT 0)'
|
||||
)
|
||||
|
||||
# recently_added table :: This table keeps record of recently added items
|
||||
|
@ -1477,6 +1477,18 @@ def dbcheck():
|
|||
'UPDATE notify_log SET success = 1'
|
||||
)
|
||||
|
||||
# Upgrade newsletter_log table from earlier versions
|
||||
try:
|
||||
c_db.execute('SELECT start_time FROM newsletter_log')
|
||||
except sqlite3.OperationalError:
|
||||
logger.debug(u"Altering database. Updating database table newsletter_log.")
|
||||
c_db.execute(
|
||||
'ALTER TABLE newsletter_log ADD COLUMN start_time INTEGER'
|
||||
)
|
||||
c_db.execute(
|
||||
'ALTER TABLE newsletter_log ADD COLUMN end_time INTEGER'
|
||||
)
|
||||
|
||||
# Upgrade library_sections table from earlier versions (remove UNIQUE constraint on section_id)
|
||||
try:
|
||||
result = c_db.execute('SELECT SQL FROM sqlite_master WHERE type="table" AND name="library_sections"').fetchone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue