mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
for #18977 # 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://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
25 lines
489 B
Go
25 lines
489 B
Go
package tables
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
)
|
|
|
|
func init() {
|
|
MigrationClient.AddMigration(Up_20240613162201, Down_20240613162201)
|
|
}
|
|
|
|
func Up_20240613162201(tx *sql.Tx) error {
|
|
_, err := tx.Exec(`
|
|
ALTER TABLE mdm_windows_enrollments
|
|
ADD INDEX idx_mdm_windows_enrollments_host_uuid (host_uuid)`,
|
|
)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to add index to mdm_windows_enrollments.host_uuid: %w", err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func Down_20240613162201(tx *sql.Tx) error {
|
|
return nil
|
|
}
|