mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Add android_devices to hosts-related tables to delete (#26568)
This commit is contained in:
parent
4abbb5e06e
commit
dd6124bff9
2 changed files with 8 additions and 0 deletions
|
|
@ -542,6 +542,7 @@ var hostRefs = []string{
|
|||
"host_mdm_actions",
|
||||
"host_calendar_events",
|
||||
"upcoming_activities",
|
||||
"android_devices",
|
||||
}
|
||||
|
||||
// NOTE: The following tables are explicity excluded from hostRefs list and accordingly are not
|
||||
|
|
|
|||
|
|
@ -7055,6 +7055,13 @@ func testHostsDeleteHosts(t *testing.T, ds *Datastore) {
|
|||
require.NoError(t, err)
|
||||
require.True(t, added)
|
||||
|
||||
// create an android device from this host
|
||||
_, err = ds.writer(context.Background()).Exec(`
|
||||
INSERT INTO android_devices (host_id, device_id)
|
||||
VALUES (?, ?);
|
||||
`, host.ID, uuid.NewString())
|
||||
require.NoError(t, err)
|
||||
|
||||
// Check there's an entry for the host in all the associated tables.
|
||||
for _, hostRef := range hostRefs {
|
||||
var ok bool
|
||||
|
|
|
|||
Loading…
Reference in a new issue