Skip to content

Commit

Permalink
fix: handle NULL paths when reconciling config_items
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Aug 22, 2024
1 parent ef6d50f commit 6e9f530
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (t ConfigItem) UpdateParentsIsPushed(db *gorm.DB, items []DBTable) error {

func (t ConfigItem) GetUnpushed(db *gorm.DB) ([]DBTable, error) {
var items []ConfigItem
err := db.Where("is_pushed IS FALSE").Order("length(path)").Find(&items).Error
err := db.Where("is_pushed IS FALSE").Order("LENGTH(COALESCE(path, ''))").Find(&items).Error
return lo.Map(items, func(i ConfigItem, _ int) DBTable { return i }), err
}

Expand Down

0 comments on commit 6e9f530

Please sign in to comment.