@@ -0,0 +1,1319 @@
+package flyway.pti3d;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0A%0Aimport org.flywaydb.core.api.migration.jdbc.JdbcMigration;%0A%0Aimport fi.nls.oskari.util.FlywayHelper;%0A%0Apublic class V1_7__remove_camera_controls_3d_bundle_from_publish_view implements JdbcMigration %7B%0A%0A%09private static final String BUNDLE_ID = %22camera-controls-3d%22;%0A%0A%09@Override%0A%09public void migrate(Connection connection) throws Exception %7B%0A%09%09final Long viewId = get3dPublishViewID(connection);%0A%09%09if (FlywayHelper.viewContainsBundle(connection, BUNDLE_ID, viewId)) %7B%0A%09%09%09FlywayHelper.removeBundleFromView(connection, BUNDLE_ID, viewId);%0A%09%09%7D%0A%09%7D%0A%0A%09private static Long get3dPublishViewID(Connection connection) throws SQLException %7B%0A%09%09StringBuilder sql = new StringBuilder(%0A%09%09%09%09%22SELECT id FROM portti_view where type='PUBLISH' AND application='embedded-3D'%22);%0A%0A%09%09try (final PreparedStatement statement = connection.prepareStatement(sql.toString())) %7B%0A%09%09%09try (ResultSet rs = statement.executeQuery()) %7B%0A%09%09%09%09if(rs.next()) %7B%0A%09%09%09%09%09return rs.getLong(%22id%22);%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09/*%0A%09%09%09%09%09 *  ID should be always found but just in case return this instead of null %0A%09%09%09%09%09 *  to prevent NullPointerExceptions in subsequent helper methods.%0A%09%09%09%09%09 */%0A%09%09%09%09%09return Long.MIN_VALUE;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add migration to remove camera controls 3d bundle from publish view