From b491be00156938d66181aa285b5fdf5acabeb064 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 8 Nov 2016 03:17:34 +0100 Subject: [PATCH 1/3] Enable sql logging to find out travis error --- src/Db/DbCursor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Db/DbCursor.py b/src/Db/DbCursor.py index 728335d91..2c2d69dfb 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 From 38a4246c8f40b8458e11090f471280498d085e47 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 8 Nov 2016 03:23:08 +0100 Subject: [PATCH 2/3] Log index creation query --- src/Db/DbCursor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Db/DbCursor.py b/src/Db/DbCursor.py index 2c2d69dfb..e21a00429 100644 --- a/src/Db/DbCursor.py +++ b/src/Db/DbCursor.py @@ -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 From ba3b9b436090b174062bafc026150e85eec4e56e Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 8 Nov 2016 03:30:15 +0100 Subject: [PATCH 3/3] Simple index for better compatibility --- plugins/OptionalManager/ContentDbPlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }