@@ -0,0 +1,1969 @@
+package org.opencb.opencga.app.migrations.v2_3_0.catalog;%0A%0Aimport com.mongodb.client.MongoCollection;%0Aimport com.mongodb.client.model.Filters;%0Aimport com.mongodb.client.model.Projections;%0Aimport com.mongodb.client.model.Updates;%0Aimport org.bson.Document;%0Aimport org.bson.conversions.Bson;%0Aimport org.opencb.opencga.catalog.db.mongodb.MongoDBAdaptorFactory;%0Aimport org.opencb.opencga.catalog.migration.Migration;%0Aimport org.opencb.opencga.catalog.migration.MigrationTool;%0A%0Aimport java.util.Arrays;%0A%0A@Migration(id = %22add_locked_to_interpretation_TASK-552%22,%0A        description = %22Add new 'locked' field to Interpretation #TASK-552%22, version = %222.3.0%22,%0A        language = Migration.MigrationLanguage.JAVA,%0A        domain = Migration.MigrationDomain.CATALOG,%0A        date = 20220401)%0Apublic class AddLockedToInterpretation extends MigrationTool %7B%0A%0A    @Override%0A    protected void run() throws Exception %7B%0A        logger.info(%22Creating new index in Interpretation collection%22);%0A        MongoCollection%3CDocument%3E interpretationCollection = getMongoCollection(MongoDBAdaptorFactory.INTERPRETATION_COLLECTION);%0A        Document lockedIndex = new Document()%0A                .append(%22locked%22, 1)%0A                .append(%22studyUid%22, 1);%0A        createIndex(interpretationCollection, lockedIndex);%0A%0A        logger.info(%22Propagating all ClinicalAnalysis 'locked' values to the related Interpretations%22);%0A        queryMongo(MongoDBAdaptorFactory.CLINICAL_ANALYSIS_COLLECTION, new Document(),%0A                Projections.include(Arrays.asList(%22id%22, %22studyUid%22, %22locked%22)), (doc) -%3E %7B%0A                    Bson query = Filters.and(%0A                        Filters.eq(%22studyUid%22, doc.get(%22studyUid%22)),%0A                        Filters.eq(%22clinicalAnalysisId%22, doc.getString(%22id%22))%0A                    );%0A                    Bson update = Updates.set(%22locked%22, doc.getBoolean(%22locked%22));%0A                    interpretationCollection.updateMany(query, update);%0A                %7D);%0A    %7D%0A%7D%0A

implement migration script, #TASK-554