mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Fix removing unique constraints from database
This commit is contained in:
parent
fb7ad9438e
commit
7193b6518b
2 changed files with 7 additions and 7 deletions
|
@ -8,10 +8,10 @@
|
||||||
* Fix: Libraries and Users lists not refreshing.
|
* Fix: Libraries and Users lists not refreshing.
|
||||||
* Fix: Server verification in settings.
|
* Fix: Server verification in settings.
|
||||||
* Fix: Empty libraries not added to database.
|
* Fix: Empty libraries not added to database.
|
||||||
* Add: Unique identifier to notification options.
|
* Add: Unique identifiers to notification options.
|
||||||
* Remove: Media type toggles for recently added notifications.
|
* Remove: Requirement of media type toggles for recently added notifications.
|
||||||
* Remove: Built in Twitter key and secret.
|
* Remove: Built in Twitter key and secret.
|
||||||
* Remove: Unnecessary quoting of script arguments.
|
* Change: Unnecessary quoting of script arguments.
|
||||||
* Change: Facebook notification instructions.
|
* Change: Facebook notification instructions.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -713,8 +713,8 @@ def dbcheck():
|
||||||
|
|
||||||
# Upgrade library_sections table from earlier versions (remove UNIQUE constraint on section_id)
|
# Upgrade library_sections table from earlier versions (remove UNIQUE constraint on section_id)
|
||||||
try:
|
try:
|
||||||
result = c_db.execute('PRAGMA index_xinfo("sqlite_autoindex_library_sections_1")')
|
result = c_db.execute('SELECT SQL FROM sqlite_master WHERE type="table" AND name="library_sections"').fetchone()
|
||||||
if result and 'server_id' not in [row[2] for row in result]:
|
if 'section_id INTEGER UNIQUE' in result[0]:
|
||||||
logger.debug(u"Altering database. Removing unique constraint on section_id from library_sections table.")
|
logger.debug(u"Altering database. Removing unique constraint on section_id from library_sections table.")
|
||||||
c_db.execute(
|
c_db.execute(
|
||||||
'CREATE TABLE library_sections_temp (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
'CREATE TABLE library_sections_temp (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
||||||
|
@ -760,8 +760,8 @@ def dbcheck():
|
||||||
|
|
||||||
# Upgrade users table from earlier versions (remove UNIQUE constraint on username)
|
# Upgrade users table from earlier versions (remove UNIQUE constraint on username)
|
||||||
try:
|
try:
|
||||||
result = c_db.execute('PRAGMA index_xinfo("sqlite_autoindex_users_2")')
|
result = c_db.execute('SELECT SQL FROM sqlite_master WHERE type="table" AND name="users"').fetchone()
|
||||||
if result and 'username' in [row[2] for row in result]:
|
if 'username TEXT NOT NULL UNIQUE' in result[0]:
|
||||||
logger.debug(u"Altering database. Removing unique constraint on username from users table.")
|
logger.debug(u"Altering database. Removing unique constraint on username from users table.")
|
||||||
c_db.execute(
|
c_db.execute(
|
||||||
'CREATE TABLE users_temp (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
'CREATE TABLE users_temp (id INTEGER PRIMARY KEY AUTOINCREMENT, '
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue