From 2f42a73b9ae3f5b447eacc907811952394f9a0e3 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Mon, 28 Sep 2020 12:36:19 -0700 Subject: [PATCH] Refactoring --- DB/Sources/DB/Content/ContentDatabase.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DB/Sources/DB/Content/ContentDatabase.swift b/DB/Sources/DB/Content/ContentDatabase.swift index 7ccaa90..b63db0b 100644 --- a/DB/Sources/DB/Content/ContentDatabase.swift +++ b/DB/Sources/DB/Content/ContentDatabase.swift @@ -397,11 +397,11 @@ private extension ContentDatabase { func clean() { databaseWriter.asyncWrite { - try TimelineStatusJoin.filter(Column("id") != Timeline.home.id).deleteAll($0) + try TimelineStatusJoin.filter(Column("timelineId") != Timeline.home.id).deleteAll($0) + try StatusContextJoin.deleteAll($0) + try AccountPinnedStatusJoin.deleteAll($0) + try AccountStatusJoin.deleteAll($0) } completion: { _, _ in } - databaseWriter.asyncWrite { try StatusContextJoin.deleteAll($0) } completion: { _, _ in } - databaseWriter.asyncWrite { try AccountPinnedStatusJoin.deleteAll($0) } completion: { _, _ in } - databaseWriter.asyncWrite { try AccountStatusJoin.deleteAll($0) } completion: { _, _ in } } } // swiftlint:enable file_length