diff options
Diffstat (limited to 'store/sqlstore/system_store.go')
-rw-r--r-- | store/sqlstore/system_store.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/store/sqlstore/system_store.go b/store/sqlstore/system_store.go index 496ff2ced..4065bb955 100644 --- a/store/sqlstore/system_store.go +++ b/store/sqlstore/system_store.go @@ -85,3 +85,14 @@ func (s SqlSystemStore) GetByName(name string) store.StoreChannel { result.Data = &system }) } + +func (s SqlSystemStore) PermanentDeleteByName(name string) store.StoreChannel { + return store.Do(func(result *store.StoreResult) { + var system model.System + if _, err := s.GetReplica().Exec("DELETE FROM Systems WHERE Name = :Name", map[string]interface{}{"Name": name}); err != nil { + result.Err = model.NewAppError("SqlSystemStore.PermanentDeleteByName", "store.sql_system.permanent_delete_by_name.app_error", nil, "", http.StatusInternalServerError) + } + + result.Data = &system + }) +} |