{"action":"created","issue":{"url":"https://api.github.com/repos/flyway/flyway/issues/1958","repository_url":"https://api.github.com/repos/flyway/flyway","labels_url":"https://api.github.com/repos/flyway/flyway/issues/1958/labels{/name}","comments_url":"https://api.github.com/repos/flyway/flyway/issues/1958/comments","events_url":"https://api.github.com/repos/flyway/flyway/issues/1958/events","html_url":"https://github.com/flyway/flyway/issues/1958","id":306226450,"number":1958,"title":"flyway migration for test does not look application.properties.","user":{"login":"SpaceNet","id":816835,"avatar_url":"https://avatars2.githubusercontent.com/u/816835?v=4","gravatar_id":"","url":"https://api.github.com/users/SpaceNet","html_url":"https://github.com/SpaceNet","followers_url":"https://api.github.com/users/SpaceNet/followers","following_url":"https://api.github.com/users/SpaceNet/following{/other_user}","gists_url":"https://api.github.com/users/SpaceNet/gists{/gist_id}","starred_url":"https://api.github.com/users/SpaceNet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpaceNet/subscriptions","organizations_url":"https://api.github.com/users/SpaceNet/orgs","repos_url":"https://api.github.com/users/SpaceNet/repos","events_url":"https://api.github.com/users/SpaceNet/events{/privacy}","received_events_url":"https://api.github.com/users/SpaceNet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-18T09:47:15Z","updated_at":"2018-03-19T08:08:10Z","closed_at":"2018-03-19T08:08:10Z","author_association":"NONE","body":"###### Which version and edition of Flyway are you using?\r\n5.0.6\r\n\r\n\r\n###### If this is not the latest version, can you reproduce the issue with the latest one as well?\r\n(Many bugs are fixed in newer releases and upgrading will often resolve the issue)\r\n\r\n\r\n\r\n###### Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)\r\nGradle plugin\r\n\r\n    buildscript {\r\n    \text {\r\n    \t\tspringBootVersion = '2.0.0.RELEASE'\r\n    \t}\r\n    \trepositories {\r\n    \t\tmavenCentral()\r\n    \t\tmaven { url \"https://repo.spring.io/snapshot\" }\r\n    \t\tmaven { url \"https://repo.spring.io/milestone\" }\r\n    \t\tmaven { url 'http://jcenter.bintray.com' }\r\n    \t\tmaven { url 'https://mvnrepository.com/artifact/com.opencsv/opencsv' }\r\n    \t}\r\n    \tdependencies {\r\n    \t    classpath(\"io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE\")\r\n    \t\tclasspath(\"org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}\")\r\n    \t\tclasspath(\"mysql:mysql-connector-java:5.1.45\")\r\n    \t}\r\n    }\r\n    \r\n    plugins {\r\n        id \"org.flywaydb.flyway\" version \"5.0.6\"\r\n    }\r\n    \r\n    flyway {\r\n    \turl = \"jdbc:mysql://localhost:3306/dev_db\"\r\n    \tuser = \"sa\"\r\n    \tpassword = \"\"\r\n    }\r\n    \r\n    apply plugin: 'java'\r\n    apply plugin: 'eclipse'\r\n    apply plugin: 'io.spring.dependency-management'\r\n    apply plugin: 'org.springframework.boot'\r\n    \r\n    group = 'test'\r\n    version = '0.0.1-SNAPSHOT'\r\n    sourceCompatibility = 1.8\r\n    \r\n    repositories {\r\n    \tmaven { url \"https://repo.spring.io/snapshot\" }\r\n        maven { url \"https://repo.spring.io/plugins-release\" }\r\n        maven { url \"https://repo.spring.io/milestone\" }\r\n        maven { url \"https://repository.jboss.org/nexus/content/repositories/releases\" }\r\n    \tmavenCentral()\r\n    }\r\n    \r\n    \r\n    dependencies {\r\n    \tcompile('org.springframework.boot:spring-boot-starter-aop')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-hateoas')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-thymeleaf')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-web')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-webflux')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-jdbc')\r\n    \tcompile('org.springframework.data:spring-data-commons')\r\n    \tcompile('org.springframework.boot:spring-boot-starter-data-jpa')\r\n    \r\n    \tcompile('org.flywaydb:flyway-core:5.0.7')\r\n        compile('org.flywaydb.flyway-test-extensions:flyway-spring5-test:5.0.0')\r\n        compile('com.h2database:h2')\r\n    \tcompile('mysql:mysql-connector-java:5.1.45')\r\n    \r\n    \tcompile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.1')\r\n        compile('org.slf4j:slf4j-api:1.7.+')\r\n        compile('org.slf4j:log4j-over-slf4j:1.7.+')\r\n        compile('org.slf4j:jcl-over-slf4j:1.7.+')\r\n    \r\n    \tcompile('net.sf.dozer:dozer:5.5.1')\r\n    \r\n    \tcompile('ch.qos.logback:logback-classic:1.2.3')\r\n    \r\n    \tcompile('com.opencsv:opencsv:4.1')\r\n    \r\n    \tcompileOnly(\"org.projectlombok:lombok:1.16.20\")\r\n    \r\n    \truntime('org.springframework.boot:spring-boot-devtools')\r\n    \truntime('com.h2database:h2')\r\n        runtime('mysql:mysql-connector-java:5.1.45')\r\n    \r\n        compile ('com.fasterxml.jackson.core:jackson-databind')\r\n        \r\n    \ttestCompile('org.springframework.boot:spring-boot-starter-test')\r\n    \ttestCompile('io.projectreactor:reactor-test')\r\n        testCompile(\"org.junit.jupiter:junit-jupiter-api\")\r\n        testRuntime(\"org.junit.jupiter:junit-jupiter-engine\")\r\n    \ttestRuntime('mysql:mysql-connector-java:5.1.45')\r\n    \ttestRuntime('com.h2database:h2')\r\n        testCompile('org.hamcrest:hamcrest-all:1.3')\r\n        testCompile('org.dbunit:dbunit:2.5.+')\r\n    \ttestCompile('mysql:mysql-connector-java:5.1.45')\r\n    \ttestCompile('com.h2database:h2')\r\n    }\r\n    \r\n\r\n\r\n###### Which database are you using (type & version)?\r\n    \ttestCompile('mysql:mysql-connector-java:5.1.45')\r\n    \ttestCompile('com.h2database:h2')\r\n\r\n\r\n###### Which operating system are you using?\r\n    \tMacOS 10.13.3\r\n\r\n\r\n###### What did you do?\r\n(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)\r\n\r\nI'm using flyway with mysql with spring boot 2.0.0\r\n\r\nThe flyway migration works for running the spring boot App, but does not work for junit5 test.\r\n\r\n    18:05:48.686 [main] ERROR o.f.core.internal.command.DbMigrate - Migration of schema \"PUBLIC\" to version 1.3.3 - ALTERItem failed! Please restore backups and roll back database and code!\r\n    18:05:48.689 [main] WARN  o.s.w.c.s.GenericWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException: \r\n    Migration V1_3_3__ALTERItem.sql failed\r\n    --------------------------------------\r\n    SQL State  : 42000\r\n    Error Code : 42000\r\n    Message    : SQLステートメントに文法エラーがあります \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"\r\n    Syntax error in SQL statement \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"; SQL statement:\r\n    ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP [42000-196]\r\n    Location   : db/migration/V1_3_3__ALTERItem.sql (/Users/user/dev/test-app/bin/main/db/migration/V1_3_3__ALTERItem.sql)\r\n    Line       : 3\r\n    Statement  : ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\n    \r\n    18:05:48.689 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated...\r\n    18:05:48.692 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed.\r\n    18:05:48.696 [main] ERROR o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@3bf9ce3e] to prepare test instance [test.someTest@5f95f1e1]\r\n    java.lang.IllegalStateException: Failed to load ApplicationContext\r\n    \tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)\r\n    \tat org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:107)\r\n    \tat org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)\r\n    \tat org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)\r\n    \tat org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:242)\r\n    \tat org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:97)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$3(ClassTestDescriptor.java:215)\r\n    \tat org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.executeAndMaskThrowable(JupiterTestDescriptor.java:141)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$4(ClassTestDescriptor.java:215)\r\n    \tat java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)\r\n    \tat java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)\r\n    \tat java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)\r\n    \tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n    \tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n    \tat java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)\r\n    \tat java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)\r\n    \tat java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeTestInstancePostProcessors(ClassTestDescriptor.java:214)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateAndPostProcessTestInstance(ClassTestDescriptor.java:196)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$0(ClassTestDescriptor.java:185)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$1(ClassTestDescriptor.java:189)\r\n    \tat java.util.Optional.orElseGet(Optional.java:267)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$2(ClassTestDescriptor.java:188)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:156)\r\n    \tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:65)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:110)\r\n    \tat org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)\r\n    \tat java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)\r\n    \tat java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)\r\n    \tat java.util.Iterator.forEachRemaining(Iterator.java:116)\r\n    \tat java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\r\n    \tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)\r\n    \tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)\r\n    \tat java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)\r\n    \tat java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)\r\n    \tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\r\n    \tat java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)\r\n    \tat org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)\r\n    \tat org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)\r\n    \tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)\r\n    \tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)\r\n    \tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)\r\n    \tat org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:86)\r\n    \tat org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)\r\n    \tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)\r\n    \tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)\r\n    \tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)\r\n    \tat org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)\r\n    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException: \r\n    Migration V1_3_3__ALTERItem.sql failed\r\n    --------------------------------------\r\n    SQL State  : 42000\r\n    Error Code : 42000\r\n    Message    : SQLステートメントに文法エラーがあります \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"\r\n    Syntax error in SQL statement \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"; SQL statement:\r\n    ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP [42000-196]\r\n    Location   : db/migration/V1_3_3__ALTERItem.sql (/Users/user/dev/test-app/bin/main/db/migration/V1_3_3__ALTERItem.sql)\r\n    Line       : 3\r\n    Statement  : ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\n    \r\n    \tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710)\r\n    \tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)\r\n    \tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)\r\n    \tat org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)\r\n    \tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)\r\n    \tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)\r\n    \tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)\r\n    \tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:304)\r\n    \tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)\r\n    \tat org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1085)\r\n    \tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:858)\r\n    \tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)\r\n    \tat org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:129)\r\n    \tat org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContext(AbstractGenericWebContextLoader.java:61)\r\n    \tat org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:107)\r\n    \tat org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:243)\r\n    \tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)\r\n    \tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)\r\n    \t... 54 common frames omitted\r\n    Caused by: org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException: \r\n    Migration V1_3_3__ALTERItem.sql failed\r\n    --------------------------------------\r\n    SQL State  : 42000\r\n    Error Code : 42000\r\n    Message    : SQLステートメントに文法エラーがあります \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"\r\n    Syntax error in SQL statement \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"; SQL statement:\r\n    ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP [42000-196]\r\n    Location   : db/migration/V1_3_3__ALTERItem.sql (/Users/user/dev/test-app/bin/main/db/migration/V1_3_3__ALTERItem.sql)\r\n    Line       : 3\r\n    Statement  : ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\n    \r\n    \tat org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:365)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.access$400(DbMigrate.java:52)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate$5.call(DbMigrate.java:297)\r\n    \tat org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:75)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:294)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:259)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.access$300(DbMigrate.java:52)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate$4.call(DbMigrate.java:179)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate$4.call(DbMigrate.java:176)\r\n    \tat org.flywaydb.core.internal.database.Connection$1.call(Connection.java:155)\r\n    \tat org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:75)\r\n    \tat org.flywaydb.core.internal.database.Connection.lock(Connection.java:151)\r\n    \tat org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:148)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:176)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:145)\r\n    \tat org.flywaydb.core.Flyway$1.execute(Flyway.java:1206)\r\n    \tat org.flywaydb.core.Flyway$1.execute(Flyway.java:1168)\r\n    \tat org.flywaydb.core.Flyway.execute(Flyway.java:1655)\r\n    \tat org.flywaydb.core.Flyway.migrate(Flyway.java:1168)\r\n    \tat org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)\r\n    \tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769)\r\n    \tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)\r\n    \t... 71 common frames omitted\r\n    Caused by: org.h2.jdbc.JdbcSQLException: SQLステートメントに文法エラーがあります \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"\r\n    Syntax error in SQL statement \"ALTER TABLE ITEM MODIFY UPDATED_AT DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON[*] UPDATE CURRENT_TIMESTAMP \"; SQL statement:\r\n    ALTER TABLE item MODIFY updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP [42000-196]\r\n    \tat org.h2.message.DbException.getJdbcSQLException(DbException.java:345)\r\n    \tat org.h2.message.DbException.get(DbException.java:179)\r\n    \tat org.h2.message.DbException.get(DbException.java:155)\r\n    \tat org.h2.message.DbException.getSyntaxError(DbException.java:191)\r\n    \tat org.h2.command.Parser.getSyntaxError(Parser.java:534)\r\n    \tat org.h2.command.Parser.prepareCommand(Parser.java:261)\r\n    \tat org.h2.engine.Session.prepareLocal(Session.java:578)\r\n    \tat org.h2.engine.Session.prepareCommand(Session.java:519)\r\n    \tat org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1204)\r\n    \tat org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:176)\r\n    \tat org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:164)\r\n    \tat com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:95)\r\n    \tat com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)\r\n    \tat org.flywaydb.core.internal.util.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:265)\r\n    \tat org.flywaydb.core.internal.database.StandardSqlStatement.execute(StandardSqlStatement.java:41)\r\n    \tat org.flywaydb.core.internal.database.ExecutableSqlScript.execute(ExecutableSqlScript.java:128)\r\n    \tat org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:75)\r\n    \tat org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:363)\r\n    \t... 92 common frames omitted\r\n\r\nthis migration is work on mysql but not on h2.\r\nI want to use mysql for junit test, how can I use mysql by flyway migration for junit tests?\r\n\r\n\r\nmy configuration class for test is\r\n\r\n    package test;\r\n    \r\n    import org.springframework.beans.BeansException;\r\n    import org.springframework.context.ApplicationContext;\r\n    import org.springframework.context.ApplicationContextAware;\r\n    import org.springframework.context.annotation.ComponentScan;\r\n    import org.springframework.context.annotation.Configuration;\r\n    import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;\r\n    \r\n    @Configuration\r\n    @ComponentScan(basePackages = {\"test\"})\r\n    public class TestWebConfig implements WebMvcConfigurer, ApplicationContextAware {\r\n    \r\n        private ApplicationContext applicationContext;\r\n    \r\n        @Override\r\n        public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\r\n            this.applicationContext = applicationContext;\r\n        }\r\n    \r\n    }\r\n\r\n\r\nmy test class is simple like below\r\n\r\n    import org.junit.jupiter.api.Test;\r\n    import org.junit.jupiter.api.TestInstance;\r\n    import org.junit.jupiter.api.TestInstance.Lifecycle;\r\n    import org.junit.jupiter.api.extension.ExtendWith;\r\n    import org.springframework.test.context.web.WebAppConfiguration;\r\n    import org.springframework.test.context.ContextConfiguration;\r\n    import org.springframework.test.context.junit.jupiter.SpringExtension;\r\n    \r\n    @ExtendWith(SpringExtension.class)\r\n    @WebAppConfiguration()\r\n    @ContextConfiguration(classes = TestWebConfig.class)\r\n    @TestInstance(Lifecycle.PER_CLASS)\r\n    public class someTest{\r\n    \r\n    \t@Test\r\n        public void testCase() throws Exception {\r\n        }\r\n    }\r\n\r\nmy application.properties is \r\n\r\n    server.port=9090\r\n    \r\n    spring.datasource.driver-class-name=com.mysql.jdbc.Driver\r\n    spring.datasource.url=jdbc:mysql://localhost:3306/dev_db\r\n    spring.datasource.username=sa\r\n    spring.datasource.password=\r\n    \r\n    spring.flyway.url=jdbc:mysql://localhost:3306/dev_db\r\n    spring.flyway.user=sa\r\n    spring.flyway.password=\r\n    \r\n    spring.flyway.baselineVersion=1\r\n    spring.flyway.baseline-on-migrate=false\r\n    \r\n    spring.messages.basename=messages\r\n    spring.messages.cache-duration=-1\r\n    spring.messages.encoding=UTF-8\r\n\r\n\r\n\r\n###### What did you expect to see?\r\n\r\nflyway migration with mysql for the test.\r\n\r\n###### What did you see instead?\r\n\r\nflyway migration with h2 for the test."},"comment":{"url":"https://api.github.com/repos/flyway/flyway/issues/comments/374130265","html_url":"https://github.com/flyway/flyway/issues/1958#issuecomment-374130265","issue_url":"https://api.github.com/repos/flyway/flyway/issues/1958","id":374130265,"user":{"login":"axelfontaine","id":684824,"avatar_url":"https://avatars2.githubusercontent.com/u/684824?v=4","gravatar_id":"","url":"https://api.github.com/users/axelfontaine","html_url":"https://github.com/axelfontaine","followers_url":"https://api.github.com/users/axelfontaine/followers","following_url":"https://api.github.com/users/axelfontaine/following{/other_user}","gists_url":"https://api.github.com/users/axelfontaine/gists{/gist_id}","starred_url":"https://api.github.com/users/axelfontaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelfontaine/subscriptions","organizations_url":"https://api.github.com/users/axelfontaine/orgs","repos_url":"https://api.github.com/users/axelfontaine/repos","events_url":"https://api.github.com/users/axelfontaine/events{/privacy}","received_events_url":"https://api.github.com/users/axelfontaine/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T08:08:10Z","updated_at":"2018-03-19T08:08:10Z","author_association":"CONTRIBUTOR","body":"That file is a Spring Boot-specific config file which the Flyway Gradle plugin doesn't know about. You must either configure the Gradle plugin in the build script or via any of the other configuration possibilities: https://flywaydb.org/documentation/gradle/#configuration"}}
{"actor":{"display_login":"axelfontaine"}}