Delete more records

This commit is contained in:
Justin Mazzocchi 2020-09-28 23:35:11 -07:00
parent f5dcb762d1
commit 303e57a163
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,7 @@ public struct ContentDatabase {
} }
try migrator.migrate(databaseWriter) try migrator.migrate(databaseWriter)
clean() try clean()
} }
} }
@ -425,14 +425,13 @@ private extension ContentDatabase {
return migrator return migrator
} }
func clean() { func clean() throws {
databaseWriter.asyncWrite { try databaseWriter.write {
try TimelineStatusJoin.filter(TimelineStatusJoin.Columns.timelineId != Timeline.home.id).deleteAll($0) try Timeline.deleteAll($0)
try StatusContextJoin.deleteAll($0) try StatusRecord.deleteAll($0)
try AccountPinnedStatusJoin.deleteAll($0) try AccountRecord.deleteAll($0)
try AccountStatusJoin.deleteAll($0)
try AccountList.deleteAll($0) try AccountList.deleteAll($0)
} completion: { _, _ in } }
} }
} }
// swiftlint:enable file_length // swiftlint:enable file_length