Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5abc884f
Unverified
Commit
5abc884f
authored
Nov 05, 2018
by
Carl Bergquist
Committed by
GitHub
Nov 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13964 from bergquist/alerting_deleted_folder
alerting: delete alerts when parent folder is deleted
parents
a1dca211
423331da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
pkg/services/sqlstore/dashboard.go
+18
-4
No files found.
pkg/services/sqlstore/dashboard.go
View file @
5abc884f
...
...
@@ -327,20 +327,34 @@ func DeleteDashboard(cmd *m.DeleteDashboardCommand) error {
if
dashboard
.
IsFolder
{
deletes
=
append
(
deletes
,
"DELETE FROM dashboard_provisioning WHERE dashboard_id in (select id from dashboard where folder_id = ?)"
)
deletes
=
append
(
deletes
,
"DELETE FROM dashboard WHERE folder_id = ?"
)
}
for
_
,
sql
:=
range
deletes
{
_
,
err
:=
sess
.
Exec
(
sql
,
dashboard
.
Id
)
dashIds
:=
[]
struct
{
Id
int64
}{}
err
:=
sess
.
SQL
(
"select id from dashboard where folder_id = ?"
,
dashboard
.
Id
)
.
Find
(
&
dashIds
)
if
err
!=
nil
{
return
err
}
for
_
,
id
:=
range
dashIds
{
if
err
:=
deleteAlertDefinition
(
id
.
Id
,
sess
);
err
!=
nil
{
return
nil
}
}
}
if
err
:=
deleteAlertDefinition
(
dashboard
.
Id
,
sess
);
err
!=
nil
{
return
nil
}
for
_
,
sql
:=
range
deletes
{
_
,
err
:=
sess
.
Exec
(
sql
,
dashboard
.
Id
)
if
err
!=
nil
{
return
err
}
}
return
nil
})
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment