fix: add index to os cve column (#26576)

> for #26178

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files)
for more information.
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
This commit is contained in:
Jahziel Villasana-Espinoza
2025-02-24 21:59:56 -05:00
committed by GitHub
co-authored by Ian Littman
parent e6c5cf002a
commit dfc58d9600
3 changed files with 28 additions and 5 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
- Fixed an issue with increased resource usage during vulnerabilities processing by adding a
database index.
- Fixed an issue with increased resource usage during vulnerabilities processing by adding
database indexes.
@@ -0,0 +1,22 @@
package tables
import (
"database/sql"
"fmt"
)
func init() {
MigrationClient.AddMigration(Up_20250224184002, Down_20250224184002)
}
func Up_20250224184002(tx *sql.Tx) error {
_, err := tx.Exec(`ALTER TABLE operating_system_vulnerabilities ADD INDEX idx_os_vulnerabilities_cve (cve);`)
if err != nil {
return fmt.Errorf("failed to add index to operating_system_vulnerabilities.cve: %w", err)
}
return nil
}
func Down_20250224184002(tx *sql.Tx) error {
return nil
}
File diff suppressed because one or more lines are too long