java - How to turn on DDL transactional support? -


i started using flywaydb , test tried create , insert queries , fired migrate ignored create table scripts :(

i used -x option debug , found strange line debug: ddl transactions supported: false

seems if made true, work.

does faced issue, if yes how rid of this? have did on new schema, clean-init-migrate full stacktrace below:

[ec2-user@ec2 flyway]$ ./flyway -x clean /usr/bin/tput flyway (command-line tool) v.3.0  debug: adding location classpath: /home/ec2-user/installables/flyway-3.0/bin/../jars/mysql-connector-java-5.1.26.jar database: jdbc:mysql://0.0.0.0:3306/test (mysql 5.5) debug: ddl transactions supported: false debug: schema: test debug: cleaning schema `test` ... cleaned schema `test` (execution time 00:00.025s)  [ec2-user@ec2 flyway]$  [ec2-user@ec2 flyway]$ ./flyway -x init /usr/bin/tput flyway (command-line tool) v.3.0  debug: adding location classpath: /home/ec2-user/installables/flyway-3.0/bin/../jars/mysql-connector-java-5.1.26.jar database: jdbc:mysql://0.0.0.0:3306/test (mysql 5.5) debug: ddl transactions supported: false debug: schema: test debug: schema `test` exists. skipping schema creation. creating metadata table: `test`.`schema_version` debug: found statement @ line 17: create table `test`.`schema_version` (     `version_rank` int not null,     `installed_rank` int not null,     `version` varchar(50) not null,     `description` varchar(200) not null,     `type` varchar(20) not null,     `script` varchar(1000) not null,     `checksum` int,     `installed_by` varchar(100) not null,     `installed_on` timestamp not null default current_timestamp,     `execution_time` int not null,     `success` bool not null ) engine=innodb debug: found statement @ line 30: alter table `test`.`schema_version` add constraint `schema_version_pk` primary key (`version`) debug: found statement @ line 32: create index `schema_version_vr_idx` on `test`.`schema_version` (`version_rank`) debug: found statement @ line 33: create index `schema_version_ir_idx` on `test`.`schema_version` (`installed_rank`) debug: found statement @ line 34: create index `schema_version_s_idx` on `test`.`schema_version` (`success`) debug: executing sql: create table `test`.`schema_version` (     `version_rank` int not null,     `installed_rank` int not null,     `version` varchar(50) not null,     `description` varchar(200) not null,     `type` varchar(20) not null,     `script` varchar(1000) not null,     `checksum` int,     `installed_by` varchar(100) not null,     `installed_on` timestamp not null default current_timestamp,     `execution_time` int not null,     `success` bool not null ) engine=innodb debug: executing sql: alter table `test`.`schema_version` add constraint `schema_version_pk` primary key (`version`) debug: executing sql: create index `schema_version_vr_idx` on `test`.`schema_version` (`version_rank`) debug: executing sql: create index `schema_version_ir_idx` on `test`.`schema_version` (`installed_rank`) debug: executing sql: create index `schema_version_s_idx` on `test`.`schema_version` (`success`) debug: metadata table `test`.`schema_version` created. debug: metadata table `test`.`schema_version` updated reflect changes schema initialized version: 1 [ec2-user@ec2 flyway]$ ./flyway -x migrate /usr/bin/tput flyway (command-line tool) v.3.0  debug: adding location classpath: /home/ec2-user/installables/flyway-3.0/bin/../jars/mysql-connector-java-5.1.26.jar database: jdbc:mysql://0.0.0.0:3306/test (mysql 5.5) debug: ddl transactions supported: false debug: schema: test debug: spring jdbc available: false debug: validating migrations ... debug: scanning filesystem resources @ '/home/ec2-user/installables/flyway-3.0/bin/../sql' (prefix: 'v', suffix: '.sql') debug: scanning resources in path: /home/ec2-user/installables/flyway-3.0/bin/../sql (/home/ec2-user/installables/flyway-3.0/bin/../sql) debug: found filesystem resource: /home/ec2-user/installables/flyway-3.0/bin/../sql/v1__cr_tbl.sql debug: found filesystem resource: /home/ec2-user/installables/flyway-3.0/bin/../sql/v2__add_people.sql validated 2 migrations (execution time 00:00.032s) debug: schema `test` exists. skipping schema creation. debug: locking table `test`.`schema_version`... debug: lock acquired table `test`.`schema_version` current version of schema `test`: 1 migrating schema `test` version 2 debug: found statement @ line 1: insert person (id, name) values (1, 'axel') debug: found statement @ line 2: insert person (id, name) values (2, 'mr. foo') debug: found statement @ line 3: insert person (id, name) values (3, 'ms. bar') debug: executing sql: insert person (id, name) values (1, 'axel') debug: rolling transaction... debug: transaction rolled error: migration of schema `test` version 2 failed! please restore backups , roll database , code! debug: metadata table `test`.`schema_version` updated reflect changes error: unexpected error org.flywaydb.core.internal.dbsupport.flywaysqlscriptexception: error executing statement @ line 1: insert person (id, name) values (1, 'axel')     @ org.flywaydb.core.internal.dbsupport.sqlscript.execute(sqlscript.java:91)     @ org.flywaydb.core.internal.resolver.sql.sqlmigrationexecutor.execute(sqlmigrationexecutor.java:73)     @ org.flywaydb.core.internal.command.dbmigrate$5.dointransaction(dbmigrate.java:287)     @ org.flywaydb.core.internal.command.dbmigrate$5.dointransaction(dbmigrate.java:285)     @ org.flywaydb.core.internal.util.jdbc.transactiontemplate.execute(transactiontemplate.java:72)     @ org.flywaydb.core.internal.command.dbmigrate.applymigration(dbmigrate.java:285)     @ org.flywaydb.core.internal.command.dbmigrate.access$800(dbmigrate.java:46)     @ org.flywaydb.core.internal.command.dbmigrate$2.dointransaction(dbmigrate.java:207)     @ org.flywaydb.core.internal.command.dbmigrate$2.dointransaction(dbmigrate.java:156)     @ org.flywaydb.core.internal.util.jdbc.transactiontemplate.execute(transactiontemplate.java:72)     @ org.flywaydb.core.internal.command.dbmigrate.migrate(dbmigrate.java:156)     @ org.flywaydb.core.flyway$1.execute(flyway.java:864)     @ org.flywaydb.core.flyway$1.execute(flyway.java:811)     @ org.flywaydb.core.flyway.execute(flyway.java:1171)     @ org.flywaydb.core.flyway.migrate(flyway.java:811)     @ org.flywaydb.commandline.main.executeoperation(main.java:120)     @ org.flywaydb.commandline.main.main(main.java:88) caused by: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: table 'test.person' doesn't exist     @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)     @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57)     @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45)     @ java.lang.reflect.constructor.newinstance(constructor.java:526)     @ com.mysql.jdbc.util.handlenewinstance(util.java:411)     @ com.mysql.jdbc.util.getinstance(util.java:386)     @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:1054)     @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:4190)     @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:4122)     @ com.mysql.jdbc.mysqlio.sendcommand(mysqlio.java:2570)     @ com.mysql.jdbc.mysqlio.sqlquerydirect(mysqlio.java:2731)     @ com.mysql.jdbc.connectionimpl.execsql(connectionimpl.java:2812)     @ com.mysql.jdbc.connectionimpl.execsql(connectionimpl.java:2761)     @ com.mysql.jdbc.statementimpl.execute(statementimpl.java:894)     @ com.mysql.jdbc.statementimpl.execute(statementimpl.java:732)     @ org.flywaydb.core.internal.dbsupport.jdbctemplate.executestatement(jdbctemplate.java:235)     @ org.flywaydb.core.internal.dbsupport.sqlscript.execute(sqlscript.java:89)     ... 16 more 

this means db not support ddl transactions. use different postgresql, db2 or sqlserver if need that.

now why scripts not being picked up, impossible tell question.

start getting started tutorial , once successful, adapt project.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -