Skip to content

Commit

Permalink
Add saved thread delete to site removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantcheese committed Aug 28, 2019
1 parent ee47be1 commit 6db85da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ public void deleteSiteByRegistryID(int id) throws SQLException {
for (Loadable loadable : siteLoadables) {
loadableIdSet.add(loadable.id);
}
//saved threads
DeleteBuilder<SavedThread, Integer> savedThreadDelete = savedThreadDao.deleteBuilder();
savedThreadDelete.where().in("loadable_id", loadableIdSet);
savedThreadDelete.delete();

//pins
DeleteBuilder<Pin, Integer> pinDelete = pinDao.deleteBuilder();
pinDelete.where().in("loadable_id", loadableIdSet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public void removeSite(Site site) {

List<Loadable> siteLoadables = databaseManager.getDatabaseLoadableManager().getLoadables(site).call();
if (!siteLoadables.isEmpty()) {
databaseManager.getDatabaseSavedThreadManager().deleteSavedThreads(siteLoadables).call();
databaseManager.getDatabasePinManager().deletePinsFromLoadables(siteLoadables).call();
databaseManager.getDatabaseHistoryManager().deleteHistory(siteLoadables).call();
databaseManager.getDatabaseLoadableManager().deleteLoadables(siteLoadables).call();
Expand Down

0 comments on commit 6db85da

Please sign in to comment.