From dbd5233945bec62afabcf6a79f6dc5a17af28a76 Mon Sep 17 00:00:00 2001 From: Pekka Helesuo Date: Tue, 20 Feb 2024 17:03:40 +0200 Subject: [PATCH] add layeranalytics bundle to all views --- .../V1_27_1__add_layeranalytics_bundle.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 asdi-resources/src/main/java/flyway/asdi2/V1_27_1__add_layeranalytics_bundle.java diff --git a/asdi-resources/src/main/java/flyway/asdi2/V1_27_1__add_layeranalytics_bundle.java b/asdi-resources/src/main/java/flyway/asdi2/V1_27_1__add_layeranalytics_bundle.java new file mode 100644 index 0000000..40fe209 --- /dev/null +++ b/asdi-resources/src/main/java/flyway/asdi2/V1_27_1__add_layeranalytics_bundle.java @@ -0,0 +1,20 @@ +package flyway.asdi2; + +import fi.nls.oskari.domain.map.view.Bundle; +import org.flywaydb.core.api.migration.BaseJavaMigration; +import org.flywaydb.core.api.migration.Context; +import org.oskari.helpers.AppSetupHelper; + +import java.sql.Connection; +import java.util.List; + +public class V1_27_1__add_layeranalytics_bundle extends BaseJavaMigration { + @Override + public void migrate(Context context) throws Exception { + Connection connection = context.getConnection(); + String bundleName = "layeranalytics"; + Bundle layerAnalyticsBundle = new Bundle(bundleName); + List appsetupIds = AppSetupHelper.getSetupsForType(connection, null); + AppSetupHelper.addOrUpdateBundleInApps(connection, layerAnalyticsBundle, appsetupIds); + } +}