@GET
    @Path("{uuid}")// uuid or dbName
    public Response migrateView(@PathParam("uuid") String uuid) {
        try {
            MigrationFeature.checkMigrationId(uuid);
        } catch (NotFoundException e) {
            Flyway flyway = locator.getService(Flyway.class, uuid);
            if (flyway == null)
                throw new NotFoundException();
            return Response.ok(flyway.info().all()).build();
        }

        Map<String, Migration> migrations = getMigrations();
        Map<String, String> model = buildPageModel(MigrationType.MIGRATE, uuid);

        String desc = model.get("description")
                .concat("&nbsp; - &nbsp;<input name=\"description\" placeholder=\"" +
                        Messages.get("view.app.database.migrate.description.placeholder")
                        + "\">");
        model.put("description", desc);

        StringBuilder tabs = new StringBuilder();
        StringBuilder diffs = new StringBuilder();

        StrSubstitutor sub = new StrSubstitutor(model);
        int i = 0;
        for (String dbName : migrations.keySet()) {
            Migration migration = migrations.get(dbName);
            ScriptInfo info = migration.generate();
            Flyway flyway = locator.getService(Flyway.class, dbName);
            boolean hasTable;
            try (Connection connection = flyway.getDataSource().getConnection()) {
                hasTable = connection.getMetaData().getTables(null, null, flyway.getTable(), null).next();
            } catch (SQLException e) {
                throw new AmebaException(e);
            }

            tabs.append("<li i=\"").append(i).append("\" class=\"db-name\">").append(dbName).append("</li>");
            diffs.append("<div class=\"diff\"><h2>");
            if (hasTable) {
                diffs.append(Messages.get("view.app.database.migrate.subTitle"));
            } else {
                diffs.append(Messages.get("view.app.database.migrate.baseline.subTitle"));
            }
            diffs.append("</h2><pre>")
                    .append(info.getApplyDdl())
                    .append("</pre></div>");
            i++;
        }
        model.put("dbNames", tabs.toString());
        model.put("diffs", diffs.toString());

        return Response.ok(sub.replace(MIGRATION_HTML))
                .type(MediaType.TEXT_HTML_TYPE)
                .build();
    }
@ GET @ Path ( "{uuid}" ) public Response migrateView ( @ PathParam ( "uuid" ) String uuid ) { try { MigrationFeature . checkMigrationId ( uuid ) ; } catch ( NotFoundException e ) { Flyway flyway = locator . getService ( Flyway . class , uuid ) ; if ( flyway == null ) throw new NotFoundException ( ) ; return Response . ok ( flyway . info ( ) . all ( ) ) . build ( ) ; } Map < String , Migration > migrations = getMigrations ( ) ; Map < String , String > model = buildPageModel ( MigrationType . MIGRATE , uuid ) ; String desc = model . get ( "description" ) . concat ( "&nbsp; - &nbsp;<input name=\"description\" placeholder=\"" + Messages . get ( "view.app.database.migrate.description.placeholder" ) + "\">" ) ; model . put ( "description" , desc ) ; StringBuilder tabs = new StringBuilder ( ) ; StringBuilder diffs = new StringBuilder ( ) ; StrSubstitutor sub = new StrSubstitutor ( model ) ; int i = 0 ; for ( String dbName : migrations . keySet ( ) ) { Migration migration = migrations . get ( dbName ) ; ScriptInfo info = migration . generate ( ) ; Flyway flyway = locator . getService ( Flyway . class , dbName ) ; boolean hasTable ; try ( Connection connection = flyway . getDataSource ( ) . getConnection ( ) ) { hasTable = connection . getMetaData ( ) . getTables ( null , null , flyway . getTable ( ) , null ) . next ( ) ; } catch ( SQLException e ) { throw new AmebaException ( e ) ; } tabs . append ( "<li i=\"" ) . append ( i ) . append ( "\" class=\"db-name\">" ) . append ( dbName ) . append ( "</li>" ) ; diffs . append ( "<div class=\"diff\"><h2>" ) ; if ( hasTable ) { diffs . append ( Messages . get ( "view.app.database.migrate.subTitle" ) ) ; } else { diffs . append ( Messages . get ( "view.app.database.migrate.baseline.subTitle" ) ) ; } diffs . append ( "</h2><pre>" ) . append ( info . getApplyDdl ( ) ) . append ( "</pre></div>" ) ; i ++ ; } model . put ( "dbNames" , tabs . toString ( ) ) ; model . put ( "diffs" , diffs . toString ( ) ) ; return Response . ok ( sub . replace ( MIGRATION_HTML ) ) . type ( MediaType . TEXT_HTML_TYPE ) . build ( ) ; }
<p>migrateView.</p>

@param uuid a {@link java.lang.String} object.
@return a {@link javax.ws.rs.core.Response} object.