Files
fleet/server/datastore/mysql/migrations/tables/20260205184907_AddAppConfigMDMWindowsEntraTenantIDs.go
T
Jordan Montgomery 9d3164113f Add entra tenant IDs migration (#39420)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #39264 

# Checklist for submitter

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

- [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/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [x] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).
2026-02-09 12:48:19 -05:00

29 lines
548 B
Go

package tables
import (
"database/sql"
"github.com/fleetdm/fleet/v4/pkg/optjson"
"github.com/fleetdm/fleet/v4/server/fleet"
)
func init() {
MigrationClient.AddMigration(Up_20260205184907, Down_20260205184907)
}
func Up_20260205184907(tx *sql.Tx) error {
if err := updateAppConfigJSON(tx, func(config *fleet.AppConfig) error {
if config != nil {
config.MDM.WindowsEntraTenantIDs = optjson.SetSlice([]string{})
}
return nil
}); err != nil {
return err
}
return nil
}
func Down_20260205184907(tx *sql.Tx) error {
return nil
}