Skip to content

CSUD: Migration to track declarations/profiles with update settings #45281

Description

@JordanMontgomery

Related user story

#38802

Task

Add a migration that adds the mdm_configuration_profile_update_settings table:

CREATE TABLE `mdm_configuration_profile_update_settings` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `windows_profile_uuid` varchar(37) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apple_declaration_uuid` varchar(37) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  `created_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  UNIQUE KEY `idx_mdm_configuration_profile_update_settings_apple_decl` (`apple_declaration_uuid`),
  UNIQUE KEY `idx_mdm_configuration_profile_update_settings_windows_profile` (`windows_profile_uuid`),
  CONSTRAINT `fk_mdm_configuration_profile_update_settings_apple_declaration_uuid` FOREIGN KEY (`apple_declaration_uuid`) REFERENCES `mdm_apple_declarations` (`declaration_uuid`) ON DELETE CASCADE,
  CONSTRAINT `fk_mdm_configuration_profile_update_settings_windows_profile_uuid` FOREIGN KEY (`windows_profile_uuid`) REFERENCES `mdm_windows_configuration_profiles` (`profile_uuid`) ON DELETE CASCADE,
  CONSTRAINT `ck_mdm_configuration_profile_update_settings_exactly_one` CHECK ((((if((`apple_declaration_uuid` is null),0,1) + if((`windows_profile_uuid` is null),0,1))) = 1))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

In the migration iterate through all user-uploaded Windows configuration profiles and Apple profiles and create rows referencing each one that includes update settings

Condition of satisfaction

Migration created including tests and backfill logic for Windows profiles and Apple declarations

Metadata

Metadata

Assignees

Labels

#g-apple-at-workProduct group focused on Apple devices~sub-taskA technical sub-task that is part of a story. (Not QA'd. Not estimated.)

Type

No type

Projects

Status
Done
Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions