diff options
author | Nathan Fischer <nfischer921@gmail.com> | 2019-04-10 14:17:55 -0700 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-04-17 08:06:46 +0200 |
commit | 6abf903f63b6cbf178b435b958822d88e26df5a7 (patch) | |
tree | 31a19d720c453b561850f15606a7c0adbbad31e4 /contrib | |
parent | bb7673afc83bac32b756863c158d7fd4455d6fee (diff) | |
download | mill-6abf903f63b6cbf178b435b958822d88e26df5a7.tar.gz mill-6abf903f63b6cbf178b435b958822d88e26df5a7.tar.bz2 mill-6abf903f63b6cbf178b435b958822d88e26df5a7.zip |
PR comments
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/flyway/src/FlywayModule.scala | 2 | ||||
-rw-r--r-- | contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql | 5 | ||||
-rw-r--r-- | contrib/flyway/test/src/BuildTest.scala | 15 |
3 files changed, 11 insertions, 11 deletions
diff --git a/contrib/flyway/src/FlywayModule.scala b/contrib/flyway/src/FlywayModule.scala index 75c66e97..f73e8e7b 100644 --- a/contrib/flyway/src/FlywayModule.scala +++ b/contrib/flyway/src/FlywayModule.scala @@ -41,7 +41,7 @@ trait FlywayModule extends JavaModule { .map(key -> _) private implicit val flywayWriter = writer[String].comap[Flyway](_.toString) - def flywayInstance = T.command { + def flywayInstance = T.worker { val jdbcClassloader = new URLClassLoader(jdbcClasspath().map(_.path.toIO.toURI.toURL).toArray) val configProps = Map(flyway.URL -> flywayUrl()) ++ diff --git a/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql b/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql new file mode 100644 index 00000000..964391a2 --- /dev/null +++ b/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql @@ -0,0 +1,5 @@ + +create table test_table ( + id bigserial primary key, + field varchar +);
\ No newline at end of file diff --git a/contrib/flyway/test/src/BuildTest.scala b/contrib/flyway/test/src/BuildTest.scala index 9f51f72c..961e0522 100644 --- a/contrib/flyway/test/src/BuildTest.scala +++ b/contrib/flyway/test/src/BuildTest.scala @@ -11,10 +11,9 @@ object BuildTest extends TestSuite { def resources = T.sources(os.pwd / 'contrib / 'flyway / 'test / 'resources) - def postgres = ivy"org.postgresql:postgresql:42.2.5" + def postgres = ivy"com.h2database:h2:1.4.199" - def flywayUrl = "jdbc:postgresql:test_db" - def flywayUser = "postgres" + def flywayUrl = "jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1" def flywayDriverDeps = Agg(postgres) } } @@ -33,14 +32,10 @@ object BuildTest extends TestSuite { count > 0, res == 1 ) - } - - 'migrateAgain - { - val eval = new TestEvaluator(Build) - val Right((res, count)) = eval(Build.build.flywayMigrate()) + val Right((resAgain, countAgain)) = eval(Build.build.flywayMigrate()) assert( - count > 0, - res == 0 + countAgain > 0, + resAgain == 0 ) } |