fleet/server/datastore/mysql/migrations/data/20210806135609_AddAllLinuxBuiltInLabels.go
Tomas Touceda 402303bc5d
Add All Linux label (#1582)
* Add All Linux label

* Change name to Linux instead of All Linux to see if e2e likes it better

* Revert "Change name to Linux instead of All Linux to see if e2e likes it better"

This reverts commit 26b79f214e.

* Fix all linux label insert
2021-08-18 15:55:48 -03:00

36 lines
639 B
Go

package data
import (
"database/sql"
"github.com/fleetdm/fleet/v4/server/fleet"
)
func init() {
MigrationClient.AddMigration(Up_20210806135609, Down_20210806135609)
}
func Up_20210806135609(tx *sql.Tx) error {
_, err := tx.Exec(`
INSERT INTO labels (
name,
description,
query,
platform,
label_type
) VALUES (?, ?, ?, ?, ?)`,
"All Linux", "All Linux distributions",
"SELECT 1 FROM osquery_info WHERE build_platform LIKE '%ubuntu%' OR build_distro LIKE '%centos%';",
"",
fleet.LabelTypeBuiltIn,
)
if err != nil {
return err
}
return nil
}
func Down_20210806135609(tx *sql.Tx) error {
return nil
}