You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
667 B
26 lines
667 B
7 years ago
|
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"')
|
||
|
except:
|
||
|
pass
|
||
|
|
||
|
try:
|
||
|
c.execute('alter table table_settings_providers add column "password" "text"')
|
||
|
except:
|
||
|
pass
|
||
|
|
||
|
# Commit change to db
|
||
|
db.commit()
|
||
|
|
||
|
# Close database connection
|
||
|
db.close()
|