{"action":"created","issue":{"url":"https://api.github.com/repos/flyway/flyway/issues/1058","labels_url":"https://api.github.com/repos/flyway/flyway/issues/1058/labels{/name}","comments_url":"https://api.github.com/repos/flyway/flyway/issues/1058/comments","events_url":"https://api.github.com/repos/flyway/flyway/issues/1058/events","html_url":"https://github.com/flyway/flyway/issues/1058","id":95458700,"number":1058,"title":"Flyway unable to migrate Redshift database","user":{"login":"slmnhq","id":14353,"avatar_url":"https://avatars.githubusercontent.com/u/14353?v=3","gravatar_id":"","url":"https://api.github.com/users/slmnhq","html_url":"https://github.com/slmnhq","followers_url":"https://api.github.com/users/slmnhq/followers","following_url":"https://api.github.com/users/slmnhq/following{/other_user}","gists_url":"https://api.github.com/users/slmnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/slmnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slmnhq/subscriptions","organizations_url":"https://api.github.com/users/slmnhq/orgs","repos_url":"https://api.github.com/users/slmnhq/repos","events_url":"https://api.github.com/users/slmnhq/events{/privacy}","received_events_url":"https://api.github.com/users/slmnhq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T15:24:03Z","updated_at":"2015-07-20T14:56:50Z","closed_at":null,"body":"It seems like Flyway is generating an SQL statement that Redshift considers to be invalid.\r\n\r\nThis happens when Flyway tries to insert a row in the ``schema_version`` table.\r\n\r\nThe error from the Redshift client JAR states ``Caused by: com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;``\r\n\r\nI have narrowed down the problem to ``org.flywaydb.core.internal.metadatatable.MetaDataTableImpl.addAppliedMigration(MetaDataTableImpl.java:115)``\r\n\r\nSee command and traceback for more info:\r\n\r\n```\r\nmvn compile -Dflyway.schemas=test_dropme -Dflyway.locations=filesystem:src/main/resources/db/analytic -Dflyway.url=jdbc:redshift://somesubdomain.redshift.amazonaws.com:5439/somedb -Dflyway.user=someuser -Dflyway.password=somepassword -Dflyway.driver=com.amazon.redshift.jdbc41.Driver flyway:baseline -Dflyway:baselineVersion=1.0.0.0 -X\r\n```\r\n\r\n```\r\n[DEBUG] DDL Transactions Supported: true\r\n[DEBUG] Schema: test_dropme\r\n[DEBUG] Scanning for filesystem resources at 'src/main/resources/db/analytic' (Prefix: '', Suffix: '.sql')\r\n[DEBUG] Scanning for resources in path: src/main/resources/db/analytic (src/main/resources/db/analytic)\r\n[DEBUG] Found filesystem resource: src/main/resources/db/analytic/V1.0.0.0__Init.sql\r\n[DEBUG] Schema \"test_dropme\" already exists. Skipping schema creation.\r\n[DEBUG] Rolling back transaction...\r\n[DEBUG] Transaction rolled back\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] BUILD FAILURE\r\n[INFO] ------------------------------------------------------------------------\r\n[INFO] Total time: 7.303 s\r\n[INFO] Finished at: 2015-07-16T10:08:46-05:00\r\n[INFO] Final Memory: 22M/227M\r\n[INFO] ------------------------------------------------------------------------\r\n[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:baseline (default-cli) on project data: org.flywaydb.core.api.FlywayException: Unable to insert row for version '0' in metadata table \"test_dropme\".\"schema_version\": [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.; -> [Help 1]\r\norg.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:baseline (default-cli) on project data: org.flywaydb.core.api.FlywayException: Unable to insert row for version '0' in metadata table \"test_dropme\".\"schema_version\"\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)\r\n\tat org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)\r\n\tat org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)\r\n\tat org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)\r\n\tat org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)\r\n\tat org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)\r\n\tat org.apache.maven.cli.MavenCli.main(MavenCli.java:157)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)\r\nCaused by: org.apache.maven.plugin.MojoExecutionException: org.flywaydb.core.api.FlywayException: Unable to insert row for version '0' in metadata table \"test_dropme\".\"schema_version\"\r\n\tat org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:526)\r\n\tat org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)\r\n\t... 19 more\r\nCaused by: com.amazon.support.exceptions.ErrorException: [Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;\r\n\tat com.amazon.redshift.client.messages.inbound.ErrorResponse.toErrorException(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.handleErrorResponse(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.handleMessage(Unknown Source)\r\n\tat com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.doMoveToNextClass(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getReadyForQuery(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.handleMessage(Unknown Source)\r\n\tat com.amazon.jdbc.communications.InboundMessagesPipeline.getNextMessageOfClass(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.doMoveToNextClass(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getReadyForQuery(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGMessagingContext.getOperationMetadata(Unknown Source)\r\n\tat com.amazon.redshift.client.PGClient.prepareStatement(Unknown Source)\r\n\tat com.amazon.redshift.dataengine.PGIQueryExecutor.<init>(Unknown Source)\r\n\tat com.amazon.redshift.dataengine.PGJDBCIDataEngine.prepare(Unknown Source)\r\n\tat com.amazon.jdbc.common.SPreparedStatement.<init>(Unknown Source)\r\n\tat com.amazon.jdbc.jdbc41.S41PreparedStatement.<init>(Unknown Source)\r\n\tat com.amazon.redshift.core.jdbc41.PGJDBC41PreparedStatement.<init>(Unknown Source)\r\n\tat com.amazon.redshift.core.jdbc41.PGJDBC41ObjectFactory.createPreparedStatement(Unknown Source)\r\n\tat com.amazon.jdbc.common.SConnection.prepareStatement(Unknown Source)\r\n\tat org.flywaydb.core.internal.dbsupport.JdbcTemplate.prepareStatement(JdbcTemplate.java:286)\r\n\tat org.flywaydb.core.internal.dbsupport.JdbcTemplate.update(JdbcTemplate.java:270)\r\n\tat org.flywaydb.core.internal.metadatatable.MetaDataTableImpl.addAppliedMigration(MetaDataTableImpl.java:115)\r\n\tat org.flywaydb.core.internal.metadatatable.MetaDataTableImpl.addBaselineMarker(MetaDataTableImpl.java:255)\r\n\tat org.flywaydb.core.internal.command.DbBaseline$2.doInTransaction(DbBaseline.java:116)\r\n\tat org.flywaydb.core.internal.command.DbBaseline$2.doInTransaction(DbBaseline.java:95)\r\n\tat org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)\r\n\tat org.flywaydb.core.internal.command.DbBaseline.baseline(DbBaseline.java:95)\r\n\tat org.flywaydb.core.Flyway$5.execute(Flyway.java:1186)\r\n\tat org.flywaydb.core.Flyway$5.execute(Flyway.java:1182)\r\n\tat org.flywaydb.core.Flyway.execute(Flyway.java:1418)\r\n\tat org.flywaydb.core.Flyway.baseline(Flyway.java:1182)\r\n\tat org.flywaydb.maven.BaselineMojo.doExecute(BaselineMojo.java:29)\r\n\tat org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:524)\r\n\tat org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)\r\n\tat org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)\r\n\tat org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)\r\n\tat org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)\r\n\tat org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)\r\n\tat org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)\r\n\tat org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)\r\n\tat org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)\r\n\tat org.apache.maven.cli.MavenCli.main(MavenCli.java:157)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:606)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)\r\n\tat org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)\r\n```"},"comment":{"url":"https://api.github.com/repos/flyway/flyway/issues/comments/122910668","html_url":"https://github.com/flyway/flyway/issues/1058#issuecomment-122910668","issue_url":"https://api.github.com/repos/flyway/flyway/issues/1058","id":122910668,"user":{"login":"slmnhq","id":14353,"avatar_url":"https://avatars.githubusercontent.com/u/14353?v=3","gravatar_id":"","url":"https://api.github.com/users/slmnhq","html_url":"https://github.com/slmnhq","followers_url":"https://api.github.com/users/slmnhq/followers","following_url":"https://api.github.com/users/slmnhq/following{/other_user}","gists_url":"https://api.github.com/users/slmnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/slmnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slmnhq/subscriptions","organizations_url":"https://api.github.com/users/slmnhq/orgs","repos_url":"https://api.github.com/users/slmnhq/repos","events_url":"https://api.github.com/users/slmnhq/events{/privacy}","received_events_url":"https://api.github.com/users/slmnhq/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T14:56:50Z","updated_at":"2015-07-20T14:56:50Z","body":"I finally got this to work by specifying ``jdbc:postgresql`` instead of ``jdbc:redshift`` as the value for ``flyway.url``.\r\n\r\nAlso, ``flyway.driver`` does not need to be specified (it should just use the default Postgres driver).\r\n\r\nI'm going to leave this issue open because the documentation should be updated to capture these caveats.\r\n\r\nThe 'correct' version of the command:\r\n\r\n``mvn compile -Dflyway.schemas=test_dropme -Dflyway.locations=filesystem:src/main/resources/db/analytic -Dflyway.url=jdbc:postgresql://somesubdomain.redshift.amazonaws.com:5439/somedb -flyway:baseline -Dflyway:baselineVersion=1.0.0.0 -X``"}}