flyway - Error Running Mixed SQL and Java Migrations - Error executing statement at line 1: package db.migration -
i'm trying run mixture of sql , java migrations via maven based on example axel fontaine here: http://www.methodsandtools.com/tools/flyway.php
basically trying execute several sql migrations, followed java migration (to load blobs table), followed sql migration.
the first set of sql migrations run fine. if specify file extension of .java java migration, gets ignored. if specify file extension of .sql java migration, gets run in correct sequence, following error:
[error] com.googlecode.flyway.core.api.flywayexception: error executing statement @ line 1: package db.migration [error] caused org.postgresql.util.psqlexception: error: syntax error @ or near "package" position: 1 [error] com.googlecode.flyway.core.api.flywayexception: migration of schema "test" version 1.0.0106 failed! changes rolled back.
here head of java migration file:
package db.migration; import com.googlecode.flyway.core.api.migration.jdbc.jdbcmigration; import java.sql.connection; import java.sql.preparedstatement; import java.io.file; any ideas i'm doing wrong?
okay, figured out going on. while flyway allows version numbers contain "." in name (ex. v1.0.0000_filename), apparently not supported java migration class names. changed class name use "" instead of "." (v1_0_1000_filename) , allowed me past original error.
Comments
Post a Comment