mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-28 19:11:30 +00:00
Delete more records
This commit is contained in:
parent
f5dcb762d1
commit
303e57a163
1 changed files with 7 additions and 8 deletions
|
@ -26,7 +26,7 @@ public struct ContentDatabase {
|
|||
}
|
||||
|
||||
try migrator.migrate(databaseWriter)
|
||||
clean()
|
||||
try clean()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,14 +425,13 @@ private extension ContentDatabase {
|
|||
return migrator
|
||||
}
|
||||
|
||||
func clean() {
|
||||
databaseWriter.asyncWrite {
|
||||
try TimelineStatusJoin.filter(TimelineStatusJoin.Columns.timelineId != Timeline.home.id).deleteAll($0)
|
||||
try StatusContextJoin.deleteAll($0)
|
||||
try AccountPinnedStatusJoin.deleteAll($0)
|
||||
try AccountStatusJoin.deleteAll($0)
|
||||
func clean() throws {
|
||||
try databaseWriter.write {
|
||||
try Timeline.deleteAll($0)
|
||||
try StatusRecord.deleteAll($0)
|
||||
try AccountRecord.deleteAll($0)
|
||||
try AccountList.deleteAll($0)
|
||||
} completion: { _, _ in }
|
||||
}
|
||||
}
|
||||
}
|
||||
// swiftlint:enable file_length
|
||||
|
|
Loading…
Reference in a new issue