DatabaseWriter.erase(): don't mess with internal SQLite objects

This commit is contained in:
Gwendal Roué committed 2018-07-07 14:42:18 +02:00
1 parent fee4486d1b
commit e84b539de2
1 file changed
+1 -1
+1 -1
View File
@@ -122,7 +122,7 @@ extension DatabaseWriter {
// Remove all database objects, one after the other
try db.inTransaction {
while let row = try Row.fetchOne(db, "SELECT type, name FROM sqlite_master") {
while let row = try Row.fetchOne(db, "SELECT type, name FROM sqlite_master WHERE name NOT LIKE 'sqlite_%'") {
let type: String = row["type"]
let name: String = row["name"]
try db.execute("DROP \(type) \(name.quotedDatabaseIdentifier)")