Alerting: Fix boolean comparison on PostgreSQL (#54730)

This commit is contained in:
George Robinson 2022-09-06 08:28:42 +01:00 committed by GitHub
parent ac93cf1db2
commit 77e53f9986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -460,7 +460,7 @@ func (st DBstore) GetAlertRulesForScheduling(ctx context.Context, query *ngmodel
}
var rules []*ngmodels.AlertRule
return st.SQLStore.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
foldersSql := "SELECT D.uid, D.title FROM dashboard AS D WHERE is_folder = 1 AND EXISTS (SELECT 1 FROM alert_rule AS A WHERE D.uid = A.namespace_uid)"
foldersSql := "SELECT D.uid, D.title FROM dashboard AS D WHERE is_folder IS TRUE AND EXISTS (SELECT 1 FROM alert_rule AS A WHERE D.uid = A.namespace_uid)"
alertRulesSql := "SELECT * FROM alert_rule"
filter, args := st.getFilterByOrgsString()
if filter != "" {