Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to switch database via gradle switch #1

Open
magro opened this issue Sep 26, 2013 · 1 comment
Open

How to switch database via gradle switch #1

magro opened this issue Sep 26, 2013 · 1 comment

Comments

@magro
Copy link

magro commented Sep 26, 2013

We have multiple datases in our gradle build configured like this:

liquibase {
  ...
  databases {
    foo {
        ...
    }
    bar {
      ...
    }
  }
  defaultDatabase = databases.foo
}

We'd like to switch the database via some switch like this

$ gradle -Pliquibase.db=bar

But how to do this? Is this already possible, and what's the correct usage?

@tlberglund
Copy link
Owner

@magro I got this to work like so:

liquibase {
  ...
  databases {
    foo {
        ...
    }
    bar {
      ...
    }
  }
  defaultDatabase = databases."${project.defaultDatabase}"
}

And a command line of:

gradlew [task] -PdefaultDatabase=sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants