Skip to content

Instantly share code, notes, and snippets.

@pavankjadda
Last active July 15, 2020 22:23
Show Gist options
  • Save pavankjadda/3095131feea19d3a4f18ce6b92cd6bb0 to your computer and use it in GitHub Desktop.
Save pavankjadda/3095131feea19d3a4f18ce6b92cd6bb0 to your computer and use it in GitHub Desktop.
Liquibase Test and Production commands.md
  1. Generate changeset between Dev and Test databases
$ mvn liquibase:diff -Ptest -Dliquibase.url="jdbc:mysql://localhost:3306/liquibasedemo-test?serverTimezone=UTC" -Dliquibase.username="root" -Dliquibase.password="bcmc1234" -Dliquibase.referenceUrl="jdbc:mysql://localhost:3306/liquibasedemo-dev?serverTimezone=UTC" -Dliquibase.referenceUsername="root" -Dliquibase.referencePassword="bcmc1234"

  1. Apply change sets to Test database
$ mvn liquibase:update -Ptest -Dliquibase.url="dbc:mysql://localhost:3306/liquibasedemo-test?serverTimezone=UTC" -Dliquibase.username="username" -Dliquibase.password="password"

  1. Generate changeset between Test and Prod databases
$ mvn liquibase:diff -Pprod -Dliquibase.url="jdbc:mysql://localhost:3306/liquibasedemo?serverTimezone=UTC" -Dliquibase.username="root" -Dliquibase.password="bcmc1234" -Dliquibase.referenceUrl="jdbc:mysql://localhost:3306/liquibasedemo-test?serverTimezone=UTC" -Dliquibase.referenceUsername="root" -Dliquibase.referencePassword="bcmc1234"

  1. Apply change sets to Prod database
$ mvn liquibase:update -Pprod -Dliquibase.url="dbc:mysql://localhost:3306/liquibasedemo?serverTimezone=UTC" -Dliquibase.username="username" -Dliquibase.password="password"

``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment