diff --git a/plugins/OptionalManager/ContentDbPlugin.py b/plugins/OptionalManager/ContentDbPlugin.py index af0681c78..84a824fbd 100644 --- a/plugins/OptionalManager/ContentDbPlugin.py +++ b/plugins/OptionalManager/ContentDbPlugin.py @@ -48,7 +48,7 @@ def getSchema(self): ], "indexes": [ "CREATE UNIQUE INDEX file_optional_key ON file_optional (site_id, inner_path)", - "CREATE INDEX deletable ON file_optional (peer, is_downloaded) WHERE peer > 10" + "CREATE INDEX is_downloaded ON file_optional (is_downloaded)" ], "schema_changed": 11 } diff --git a/src/Db/DbCursor.py b/src/Db/DbCursor.py index 728335d91..e21a00429 100644 --- a/src/Db/DbCursor.py +++ b/src/Db/DbCursor.py @@ -10,7 +10,7 @@ def __init__(self, conn, db): self.conn = conn self.db = db self.cursor = conn.cursor() - self.logging = False + self.logging = True def execute(self, query, params=None): if isinstance(params, dict) and "?" in query: # Make easier select and insert by allowing dict params @@ -96,6 +96,7 @@ def createTable(self, table, cols): def createIndexes(self, table, indexes): # indexes.append("CREATE INDEX %s_id ON %s(%s_id)" % (table, table, table)) # Primary key index for index in indexes: + self.db.log.debug("Creatig index: %s" % index) self.execute(index) # Create table if not exist