@@ -0,0 +1,1815 @@
+package org.opencb.opencga.app.migrations.v2_2_1.storage;%0A%0Aimport org.opencb.opencga.app.migrations.StorageMigrationTool;%0Aimport org.opencb.opencga.catalog.migration.Migration;%0Aimport org.opencb.opencga.storage.core.metadata.VariantStorageMetadataManager;%0Aimport org.opencb.opencga.storage.core.metadata.models.StudyMetadata;%0Aimport org.opencb.opencga.storage.core.variant.VariantStorageEngine;%0A%0A@Migration(id = %22sample_index_configuration_add_missing_status%22,%0A        description = %22Sample index configuration add missing status #TASK-512%22, version = %222.2.0%22,%0A        language = Migration.MigrationLanguage.JAVA,%0A        domain = Migration.MigrationDomain.STORAGE,%0A        date = 20220328)%0Apublic class SampleIndexConfigurationAddMissingStatus extends StorageMigrationTool %7B%0A    @Override%0A    protected void run() throws Exception %7B%0A        for (String project : getVariantStorageProjects()) %7B%0A            VariantStorageEngine engine = getVariantStorageEngineByProject(project);%0A            VariantStorageMetadataManager metadataManager = engine.getMetadataManager();%0A            for (Integer studyId : metadataManager.getStudyIds()) %7B%0A                StudyMetadata study = metadataManager.getStudyMetadata(studyId);%0A                if (study.getSampleIndexConfigurations().stream().anyMatch(sc -%3E sc.getStatus() == null)) %7B%0A                    metadataManager.updateStudyMetadata(studyId, sm -%3E %7B%0A                        for (StudyMetadata.SampleIndexConfigurationVersioned sc : sm.getSampleIndexConfigurations()) %7B%0A                            if (sc.getStatus() == null) %7B%0A                                sc.setStatus(StudyMetadata.SampleIndexConfigurationVersioned.Status.ACTIVE);%0A                            %7D%0A                        %7D%0A                    %7D);%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add migration to add default status at sample-index-configurations. TASK-512