Skip to content

Commit

Permalink
Delete old panels from database
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Dec 16, 2024
1 parent 5d4f3c7 commit ff9cf4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Shared/Panels/PanelsUpdater.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import PromiseKit
import GRDB

public protocol PanelsUpdaterProtocol {
func update()
Expand Down Expand Up @@ -36,6 +37,8 @@ final class PanelsUpdater: PanelsUpdaterProtocol {

do {
try Current.database.write { db in
try AppPanel.filter(Column(DatabaseTables.AppPanel.serverId.rawValue) == server.identifier.rawValue)
.deleteAll(db)
for panel in appPanels {
try panel.save(db)
}
Expand Down

0 comments on commit ff9cf4d

Please sign in to comment.