         for (sql, args) in queries {
             if !run(db, sql: sql, args: args) {
                 return false
+            }
+        }
+        return true
+    }
+
+    func runValidQueries(db: SQLiteDBConnection, queries: [(String?, Args?)]) -> Bool {
+        for (sql, args) in queries {
+            if let sql = sql {
+                if !run(db, sql: sql, args: args) {
+                    return false
+                }
             }
         }
         return true


        if from < 5 && to >= 5  {
            let queries: [(String?, Args?)] = [(getQueueTableCreationString(forVersion: to), nil)]
            if !self.run(db, queries: queries.filter({ $0.0 != nil }).map({ ($0.0!, $0.1) })) {
                return false
            }
        }

                ("ALTER TABLE \(TableHistory) ADD COLUMN domain_id INTEGER REFERENCES \(TableDomains)(id) ON DELETE CASCADE", nil)
            ]

            if !self.runValidQueries(db, queries: queries) {
                return false
            }

