Remove useless code

This commit is contained in:
Gwendal Roué committed 2016-12-01 10:43:10 +01:00
1 parent e64250c519
commit bf76567fdf
1 file changed
-2
-2
View File
@@ -941,8 +941,6 @@ extension Database {
/// Returns whether a table exists.
public func tableExists(_ tableName: String) throws -> Bool {
SchedulingWatchdog.preconditionValidQueue(self)
// SQlite identifiers are case-insensitive, case-preserving (http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html)
return try Row.fetchOne(self, "SELECT 1 FROM (SELECT sql, type, name FROM sqlite_master UNION SELECT sql, type, name FROM sqlite_temp_master) WHERE type = 'table' AND LOWER(name) = ?", arguments: [tableName.lowercased()]) != nil
}