Add missing index to MDM Windows enrollments table (#17559)

This commit is contained in:
Martin Angers 2024-03-13 11:27:37 -04:00 committed by GitHub
parent 2522cc5ef6
commit 0f8192348b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 30 additions and 3 deletions

View File

@ -1 +1,2 @@
* Added Windows MDM support to the `osquery-perf` host-simulation command.
* Added a missing database index to the MDM Windows enrollments table that will improve performance at scale.

View File

@ -0,0 +1,25 @@
package tables
import (
"database/sql"
"fmt"
)
func init() {
MigrationClient.AddMigration(Up_20240312103753, Down_20240312103753)
}
func Up_20240312103753(tx *sql.Tx) error {
_, err := tx.Exec(`
ALTER TABLE mdm_windows_enrollments
ADD INDEX idx_mdm_windows_enrollments_mdm_device_id (mdm_device_id)`,
)
if err != nil {
return fmt.Errorf("failed to add index to mdm_windows_enrollments.mdm_device_id: %w", err)
}
return nil
}
func Down_20240312103753(tx *sql.Tx) error {
return nil
}

File diff suppressed because one or more lines are too long