Giter Club home page Giter Club logo

flyway-sbt's Introduction

Database Migrations Made Easy.

Flyway

Evolve your database schema easily and reliably across all your instances.

Simple, focused and powerful.

Works on

Windows, macOS, Linux, Docker and Java

Supported build tools

Maven and Gradle

Supported databases

Aurora MySQL, Aurora PostgreSQL, Azure Synapse, Clickhouse, CockroachDB, DB2, Derby, Firebird, Google BigQuery, Google Cloud Spanner, H2, HSQLDB, Informix, MariaDB, MongoDB, MySQL, Oracle, Percona XtraDB Cluster, PostgreSQL, Redshift, SAP HANA (Including SAP HANA Cloud), SingleStoreDB, Snowflake, SQLite, SQL Server, Sybase ASE, TiDB, TimescaleDB, YugabyteDB

Third party plugins

SBT, Ant, Spring Boot, Grails, Play!, DropWizard, Grunt, Griffon, Ninja, ...

Documentation

You can find our getting started guides here. Our reference documentation can be found here.

About

Flyway is brought to you by Redgate with the help of many contributors.

See our post Flyway V10 has landed for our current major changes and improvements for the community

How to contribute

Please visit our contribution page to find out how you can contribute in various ways to the project.

License

Copyright © Red Gate Software Ltd 2010-2024

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Trademark

Flyway is a registered trademark of Boxfuse GmbH, owned by Red Gate Software Ltd.

flyway-sbt's People

Contributors

bitnot avatar danirey avatar davidmweber avatar djx314 avatar dkichler avatar dnskimo avatar etspaceman avatar ldrygala avatar mikielagutu avatar nerdydrew avatar reid-spencer avatar sergiuszkierat avatar smur89 avatar snehalraj avatar sullis avatar takayahilton avatar vincibean avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flyway-sbt's Issues

Missing Tasks

I am missing almost all the tasks:

sbt:root> flyway
flywayLocations   flywayPassword    flywayUrl         flywayUser  

SBT version 1.3.10

project/plugins.sbt

addSbtPlugin("io.github.davidmweber" % "flyway-sbt" % "6.4.2")

Add docs for Flyway Pro and Enterprise Edition usage

The only two changes that are needed are:

Adding an S3 resolvers in project/project/plugin.sbt

addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.14.0")

Excluding the Community Edition flyway-core artifact in project/plugin.sbt and replacing it with the desired edition which will be downloaded from our private repo:

Pro:

s3CredentialsProvider := { (bucket: String) =>
  new com.amazonaws.auth.AWSStaticCredentialsProvider(new com.amazonaws.auth.BasicAWSCredentials("your-flyway-pro-user", "your-flyway-pro-password"))
}
resolvers += "Flyway Repo" at "s3://flyway-repo/release"
addSbtPlugin("io.github.davidmweber" % "flyway-sbt" % "5.0.0-RC2" exclude("org.flywaydb", "flyway-core"))
libraryDependencies += "org.flywaydb.pro" % "flyway-core" % "5.0.7"

Enterprise:

s3CredentialsProvider := { (bucket: String) =>
  new com.amazonaws.auth.AWSStaticCredentialsProvider(new com.amazonaws.auth.BasicAWSCredentials("your-flyway-enterprise-user", "your-flyway-enterprise-password"))
}
resolvers += "Flyway Repo" at "s3://flyway-repo/release"
addSbtPlugin("io.github.davidmweber" % "flyway-sbt" % "5.0.0-RC2" exclude("org.flywaydb", "flyway-core"))
libraryDependencies += "org.flywaydb.enterprise" % "flyway-core" % "5.0.7"

Please include this in the README and the manual.

Update to Flyway 6.5.7

There is currently an open pull request to update to Flyway 6.5.5. However, Flyway 6.5.7 was just released yesterday that updates the Postgres driver version due to a known XXE vulnerability.

Instead of going to 6.5.5 it would be beneficial to just make the jump to 6.5.7 to ensure that the vulnerability is handled.

New releases

Hello!

Any reason why in Maven Central the 6.5.0 is the latest version. Although it seems like 7+ versions are out already.. Would really want to have my flyway-core match flyway-sbt version.

I might be misunderstanding how to add the newer versions (even though 6.5.0 works fine), but neither the option in docs, nor even adding sonatype snapshot repo helps.

How to make migration task fail for missing migrations?

I'm trying to have flyway/sbt produce an error (rather than a warning) when migrations are missing, but I haven't been able to find any options that would present this behavior. Specifically, I would like sbt to exit with a non-zero exit status if a migration is missing - the same behavior as when a migration has been modified after apply.

Is there some setting/configuration that I can change to do this?

> sbt flyway/flywayMigrate
[info] Loading settings for project global-plugins from idea.sbt ...
[info] Loading global plugins from __user__/.sbt/1.0/plugins
[info] Loading project definition from __user__/flyway_spike/project/project
[info] Loading settings for project flyway_spike-build from plugins.sbt ...
[info] Loading project definition from __user__/flyway_spike/project
[info] Loading settings for project flyway from build.sbt ...
[info] Loading settings for project flyway_spike from build.sbt ...
[info] Set current project to flyway_spike (in build file:__user__/flyway_spike/)
[info] Flyway Community Edition 5.2.0 by Boxfuse
[info] Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 10.5)
[info] Successfully validated 1 migration (execution time 00:00.014s)
[info] Current version of schema "public": 20181018
[warn] Schema "public" has version 20181018, but no migration could be resolved in the configured locations !
[info] Schema "public" is up to date. No migration necessary.
[success] Total time: 0 s, completed 19/10/2018 12:58:17 PM

Multiple configuration values

I want flyway to work with different databases regarding the task (production or test)

Here are parts of my build.sbt:

lazy val FunctionalTest = config("functional") extend Test

testOptions in FunctionalTest += Tests.Setup( () => {
  flywayUrl :=  "jdbc:postgresql://127.0.0.1/test"
  flywayMigrate.value // should run migration on test database
} )

flywayUrl := "jdbc:postgresql://127.0.0.1/production"
flywayUser := sys.env.getOrElse("PSQL_USER", default = "none")
flywayPassword := sys.env.getOrElse("PSQL_PASSWORD", default = "none")
[sbt] $ functional:test
[info] Flyway 4.2.0 by Boxfuse
[info] Database: jdbc:postgresql://127.0.0.1/production (PostgreSQL 10.2)

It seems that the configuration has already been created and flyWayUrl cannot be changed anymore.
Can you confirm my guess and / or expose a solution ?

Thanks in advance :)

H2 support removed by mistake? #2467

flyway/flyway#2467

Which version and edition of Flyway are you using?
6.0.0

Which database are you using (type & version)?
H2

Which operating system are you using?
Linux

Exception:
Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: H2
at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:226) ~[flyway-core-6.0.0.jar:?]
at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:107) ~[flyway-core-6.0.0.jar:?]
at org.flywaydb.core.Flyway.execute(Flyway.java:472) ~[flyway-core-6.0.0.jar:?]
at org.flywaydb.core.Flyway.clean(Flyway.java:285) ~[flyway-core-6.0.0.jar:?]

=> Think the commit f9bd09b removed H2 support in DatabaseFactory.java by mistake.

Unable to resolve location classpath:db/migration

i've been trying to setup a project i've been working on with flyway-sbt
but i keep on having the following error 👍

MacBook-Pro-2:FraudApi banana$ sbt flywayMigrate
[info] Loading global plugins from /Users/banana/.sbt/1.0/plugins
[info] Loading settings for project fraudapi-build from plugins.sbt ...
[info] Loading project definition from /Users/banana/IdeaProjects/fraudman/FraudApi/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to FraudAPI (in build file:/Users/banana/IdeaProjects/fraudman/FraudApi/)
[info] Flyway Community Edition 5.2.0 by Boxfuse
[info] Database: jdbc:postgresql://localhost:5444/fraudman (PostgreSQL 10.6)
[warn] Unable to resolve location classpath:db/migration
[info] Successfully validated 0 migrations (execution time 00:00.011s)
[info] Creating Schema History table: "public"."flyway_schema_history"
[info] Current version of schema "public": << Empty Schema >>
[info] Schema "public" is up to date. No migration necessary.
[success] Total time: 1 s, completed Jan 23, 2019 4:41:47 PM

within build.sbt

flywayLocations += "db/migration"

Migrate to Flyway 5.0.x

Update the plugin to work with Flyway's 5.0.x release. The manual-plugin-enable branch is a reasonable release candidate.

CI, deployment and sbt 0.13.x

We need to get travis up and running. My travis account can see this repo but cannot add it. I expect we should rather use the flyway travis in future. We also need to get deployment working properly. I can set this up in sbt but it needs credentials on maven and hidden some place in travis....

sbt 0.13.x is problematic because there is no plugin test framework. Cross building efforts have failed
so far. I suggest that we maintain the 0.13.x as is in the flyway repo until we can drop support for it and
maintain support for 1.x here. Let me know what you think.

Apart from these things, we are ready to roll.

@axelfontaine ?

Custom Configuration failing for Postgresql

Postgresql configuration works fine with normal flyway configuration but fails with custom configurations as below:

I am running it using: sbt app/prod:flywayInfo

enablePlugins(FlywayPlugin)

lazy val CustomConfig = config("custom") describedAs "A custom config." extend Runtime

lazy val customSettings: Seq[Def.Setting[_]] = Seq(
  flywayUser := "customUser",
  flywayPassword := "customPassword",
  flywayUrl := "jdbc:postgresql://host:port/db",
  flywayLocations += "db/migration"
)

// flywayBaseSettings(CustomConfig) doesnt work and is replaced by flywayBaseSettings(Runtime)
lazy val app = (project in file("app")).
  settings(inConfig(CustomConfig)(FlywayPlugin.flywayBaseSettings(Runtime) ++ customSettings): _*)

The custom configuration keeps failing for postgresql driver. Below is the stacktrace

org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: org.postgresql.Driver => Check whether the jar file is present
[error]         at org.flywaydb.core.internal.util.jdbc.DriverDataSource.<init>(DriverDataSource.java:136)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1435)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1414)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configureSysProps$extension(FlywayPlugin.scala:295)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configure$extension0(FlywayPlugin.scala:239)
[error]         at io.github.davidmweber.FlywayPlugin$Flyway$.apply(FlywayPlugin.scala:219)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$48(FlywayPlugin.scala:181)
[error]         at io.github.davidmweber.FlywayPlugin$.withContextClassLoader(FlywayPlugin.scala:210)
[error]         at io.github.davidmweber.FlywayPlugin$.withPrepared(FlywayPlugin.scala:193)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47(FlywayPlugin.scala:180)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47$adapted(FlywayPlugin.scala:180)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:66)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:271)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class org.postgresql.Driver : org.postgresql.Driver
[error]         at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:61)
[error]         at org.flywaydb.core.internal.util.jdbc.DriverDataSource.<init>(DriverDataSource.java:132)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1435)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1414)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configureSysProps$extension(FlywayPlugin.scala:295)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configure$extension0(FlywayPlugin.scala:239)
[error]         at io.github.davidmweber.FlywayPlugin$Flyway$.apply(FlywayPlugin.scala:219)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$48(FlywayPlugin.scala:181)
[error]         at io.github.davidmweber.FlywayPlugin$.withContextClassLoader(FlywayPlugin.scala:210)
[error]         at io.github.davidmweber.FlywayPlugin$.withPrepared(FlywayPlugin.scala:193)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47(FlywayPlugin.scala:180)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47$adapted(FlywayPlugin.scala:180)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:66)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:271)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
[error]         at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[error]         at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error]         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error]         at java.lang.Class.forName0(Native Method)
[error]         at java.lang.Class.forName(Class.java:348)
[error]         at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:59)
[error]         at org.flywaydb.core.internal.util.jdbc.DriverDataSource.<init>(DriverDataSource.java:132)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1435)
[error]         at org.flywaydb.core.Flyway.configure(Flyway.java:1414)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configureSysProps$extension(FlywayPlugin.scala:295)
[error]         at io.github.davidmweber.FlywayPlugin$FlywayOps$.configure$extension0(FlywayPlugin.scala:239)
[error]         at io.github.davidmweber.FlywayPlugin$Flyway$.apply(FlywayPlugin.scala:219)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$48(FlywayPlugin.scala:181)
[error]         at io.github.davidmweber.FlywayPlugin$.withContextClassLoader(FlywayPlugin.scala:210)
[error]         at io.github.davidmweber.FlywayPlugin$.withPrepared(FlywayPlugin.scala:193)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47(FlywayPlugin.scala:180)
[error]         at io.github.davidmweber.FlywayPlugin$.$anonfun$flywayBaseSettings$47$adapted(FlywayPlugin.scala:180)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:66)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:271)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (app / Prod / flywayInfo) org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: org.postgresql.Driver => Check whether the jar file is present

Might be related to flyway/flyway#1923

Prevent compile task being triggered prior to a flyway task being run

SBT insists on compiling sources when running a flyway task. This is problematic for people who use code generators such as Slick and can mean a simple operation like flywayClean being very slow due to the compilation that gets triggered. I am really not sure why SBT is triggering the compile or how to prevent it. Ideas welcome.

Don't enable the plugin automatically

This is to track flyway/flyway#1329 over here. Something about the order things are applied in now causes errors like:

[error] sbt.AutoPluginException: Error determining plugins for project 'server' in ...:
[error] Contradiction in selected plugins.  These plugins were both included and excluded: org.flywaydb.sbt.FlywayPlugin

when trying to use .disablePlugins(FlywayPlugin).

Don't compile when migrating the database

The current plugin insists on doing a full compile before it migrates the database. The correct behaviour should be to just migrate the database or whatever without compiling. If you use a database generator like slick, you will have felt the pain.

flywayInfo doesn't log anything?

The flywayInfo task calls info() on the underlying Flyway instance and apparently logs the result as an ASCII table, but I don't see that getting logged anywhere—all it logs is the [success] line. Other log messages get logged, like from Flyway itself, but not the flywayInfo table. I can reproduce this in the repo's test projects like below:

$ cd flyway-sbt/src/sbt-test/flyway-sbt/test1/
$ sbt -Dplugin.version=5.2.0
[info] Loading settings for project global-plugins from idea.sbt,plugins.sbt ...
[info] Loading global plugins from /Users/dmitchell/.sbt/1.0/plugins
[info] Loading settings for project test1-build from plugins.sbt ...
[info] Loading project definition from /Users/dmitchell/Desktop/flyway-sbt/src/sbt-test/flyway-sbt/test1/project
[info] Loading settings for project test1 from build.sbt ...
[info] Set current project to flyway-sbt-test1 (in build file:/Users/dmitchell/Desktop/flyway-sbt/src/sbt-test/flyway-sbt/test1/)
[info] sbt server started at local:///Users/dmitchell/.sbt/1.0/server/59211cc02ab3a2b863eb/sock
sbt:flyway-sbt-test1> flywayInfo
[success] Total time: 0 s, completed Dec 12, 2018 1:43:29 PM

Is anyone else experiencing this? Anyone know how to fix it?

Plugin is validating but not processing updates in migrate task

When running flywayMigrate, the validation phase is completed successfully but the migration fails to run: The output is as follows:

[info] [info] Database: jdbc:hsqldb:file:target/flyway_sample;shutdown=true (HSQL Database Engine 2.2)
[info] [info] Successfully cleaned schema "PUBLIC" (execution time 00:00.002s)
[info] [success] Total time: 0 s, completed 22 Feb 2018 12:28:16 PM
[info] [info] Database: jdbc:hsqldb:file:target/flyway_sample;shutdown=true (HSQL Database Engine 2.2)
[info] [info] Successfully validated 2 migrations (execution time 00:00.009s)
[info] [info] Creating Schema History table: "PUBLIC"."flyway_schema_history"
[info] [info] Current version of schema "PUBLIC": << Empty Schema >>
[info] [info] Schema "PUBLIC" is up to date. No migration necessary.

For some reason (presumably something in the configuration of the plugin) has changed.

How to use environment variables on sbt flyway plugin?

Environment Variables

The Flyway command-line tool, Maven plugin and Gradle plugin support loading configuration via environment variables. This also possible using the Flyway API by calling the envVars() method on the configuration.

Cross building for 0.13.16

The testing is done with sbt 1.x's plugin test framework which does not exist for 0.13.x (more specifically scala 2.10). If anyone knows how we should go about this, please let me know.

Proposing to move this repo to the SBT org

Hi everyone,
We think that this repo would be better served as part of the sbt organization rather than the Flyway one.

mkurz has been in touch about making this happen.

Please add a comment if you have any concerns - otherwise we'll aim to do this soon (April/May 2024).

Not able to run command line options in sbt shell

I'm trying to run flywayMigrate on a different database as opposed to the once that I have already configured in my build.sbt

For that, I'm trying to pass cli arguments in sbt shell like so, flyway -url="jdbc:postgresql://someserver:1234/testdb" -driver="org.postgresql.Driver" -username="postgres" -password="abcd" migrate
OR
flyway -configFiles=path/to/myAlternativeConfig.conf migrate

But looks like sbt doesn't take cli arguments dynamically this way: https://flywaydb.org/documentation/commandline/#command-line-arguments

Can someone help me with this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.