2017-12-05 00:01:10 +00:00
|
|
|
import os
|
|
|
|
import sqlite3
|
|
|
|
|
|
|
|
# Check if database exist
|
|
|
|
if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) == True:
|
|
|
|
# Open database connection
|
|
|
|
db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
|
|
|
c = db.cursor()
|
|
|
|
|
|
|
|
# Execute table modification
|
|
|
|
try:
|
|
|
|
c.execute('alter table table_settings_providers add column "username" "text"')
|
2017-12-08 01:31:17 +00:00
|
|
|
c.execute('UPDATE table_settings_providers SET username=""')
|
2017-12-05 00:01:10 +00:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
|
|
|
try:
|
|
|
|
c.execute('alter table table_settings_providers add column "password" "text"')
|
2017-12-08 01:31:17 +00:00
|
|
|
c.execute('UPDATE table_settings_providers SET password=""')
|
2017-12-05 00:01:10 +00:00
|
|
|
except:
|
|
|
|
pass
|
2017-12-19 01:24:04 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
c.execute('alter table table_shows add column "audio_language" "text"')
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2017-12-23 03:40:14 +00:00
|
|
|
try:
|
|
|
|
c.execute('alter table table_settings_general add column "configured" "integer"')
|
|
|
|
c.execute('alter table table_settings_general add column "updated" "integer"')
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2017-12-05 00:01:10 +00:00
|
|
|
# Commit change to db
|
|
|
|
db.commit()
|
|
|
|
|
|
|
|
# Close database connection
|
|
|
|
db.close()
|