@@ -0,0 +1,1200 @@
+package flyway.myplaces;%0A%0Aimport fi.nls.oskari.db.DatasourceHelper;%0Aimport fi.nls.oskari.geoserver.GeoserverPopulator;%0Aimport org.flywaydb.core.api.migration.jdbc.JdbcMigration;%0Aimport org.json.JSONObject;%0A%0Aimport javax.sql.DataSource;%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0A%0Apublic class V1_0_13__add_formatting_metadata implements JdbcMigration %7B%0A%0A    public void migrate(Connection ignored) throws Exception %7B%0A        // myplaces _can_ use other db than the default one%0A        // -%3E Use connection to default db for this migration%0A        DataSource ds = DatasourceHelper.getInstance().getDataSource();%0A        if (ds == null) %7B%0A            ds = DatasourceHelper.getInstance().createDataSource();%0A        %7D%0A        Connection conn = ds.getConnection();%0A        JSONObject attributes = GeoserverPopulator.addMyplacesAttributes(GeoserverPopulator.createUserContentAttributes());%0A        final String sql = %22update oskari_maplayer set attributes =? where name = 'oskari:my_places';%22;%0A%0A        try (final PreparedStatement statement = conn.prepareStatement(sql)) %7B%0A            statement.setString(1, attributes.toString());%0A            statement.execute();%0A        %7D%0A    %7D%0A%0A%7D%0A

Update attributes for myplaces baselayer