diff --git a/models/config.go b/models/config.go index 0dd53af1..2763e3c0 100644 --- a/models/config.go +++ b/models/config.go @@ -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 }