database:liquibase
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
database:liquibase [2019/07/09 14:21] – skipidar | database:liquibase [2023/11/01 07:13] (current) – ↷ Page moved from business_process_management:camunda:database:liquibase to database:liquibase skipidar | ||
---|---|---|---|
Line 8: | Line 8: | ||
</ | </ | ||
- | == how it works== | + | === how it works=== |
Liquibase stores all metadata in 2 tables: | Liquibase stores all metadata in 2 tables: | ||
< | < | ||
Line 16: | Line 16: | ||
- | ==Syntax of the call== | + | ===Syntax of the call=== |
+ | |||
+ | == H2 == | ||
* There is the syntax of the liquibase call. | * There is the syntax of the liquibase call. | ||
* The Driver name: org.h2.Driver | * The Driver name: org.h2.Driver | ||
Line 23: | Line 26: | ||
liquibase --driver=org.h2.Driver --classpath=" | liquibase --driver=org.h2.Driver --classpath=" | ||
</ | </ | ||
+ | |||
+ | == Postgres == | ||
+ | < | ||
+ | wget -O liquibase.tar.gz https:// | ||
+ | tar -xzvf liquibase.tar.gz | ||
+ | |||
+ | |||
+ | |||
+ | wget -O postgresql-jdbc4.jar https:// | ||
+ | |||
+ | chmod +x postgresql-jdbc4.jar | ||
+ | |||
+ | ./liquibase --driver=org.postgresql.Driver --classpath="/ | ||
+ | </ | ||
+ | |||
+ | |||
== Example changeset== | == Example changeset== | ||
Line 117: | Line 136: | ||
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | === With Spring Boot === | ||
+ | |||
+ | |||
+ | == INit the DB at start == | ||
+ | |||
+ | To init the table - you only need the core **org.liquibase: | ||
+ | |||
+ | build.gradle | ||
+ | <sxh perl> | ||
+ | dependencies { | ||
+ | // liquibase | ||
+ | compile ' | ||
+ | |||
+ | // get the to the classpath which is needed but not loaded with " | ||
+ | compile group: ' | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | application.properties | ||
+ | <sxh perl> | ||
+ | # https:// | ||
+ | spring.datasource.driver-class-name=org.postgresql.Driver | ||
+ | spring.datasource.username=postgres | ||
+ | spring.datasource.password=postgres | ||
+ | spring.datasource.host=localhost | ||
+ | spring.datasource.port=5432 | ||
+ | spring.datasource.database=postgres | ||
+ | spring.datasource.url=jdbc: | ||
+ | |||
+ | |||
+ | |||
+ | # Liquibase without prefix | ||
+ | # | ||
+ | spring.liquibase.enabled=true | ||
+ | spring.liquibase.change-log=classpath:/ | ||
+ | spring.liquibase.default-schema=public | ||
+ | spring.liquibase.user=postgres | ||
+ | spring.liquibase.password=postgres | ||
+ | |||
+ | # will be taken from spring.* | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | resources/ | ||
+ | < | ||
+ | databaseChangeLog: | ||
+ | - includeAll: | ||
+ | path: db/ | ||
+ | </ | ||
+ | |||
+ | resources/ | ||
+ | < | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <column name=" | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | | ||
+ | ... | ||
+ | </ | ||
+ | |||
database/liquibase.1562682113.txt.gz · Last modified: (external edit)