|
|
## Liquibase ##
|
|
|
|
|
|
Liquibase allows you to run certain migrations depending on the dmbs you are executing the migration on.
|
|
|
This can be done as follows:
|
|
|
```yaml
|
|
|
- changeSet:
|
|
|
- id: 3-1
|
|
|
- author: "Liam Clark"
|
|
|
- preconditions:
|
|
|
dbms: "h2"
|
|
|
- changes:
|
|
|
- createSequence:
|
|
|
sequenceName: "HIBERNATE_SEQUENCE"
|
|
|
```
|
|
|
|
|
|
The names of the dmbs liquibase expects can be found [here](https://www.liquibase.org/databases.html)
|
|
|
|
|
|
|
|
|
apply liquibase changelog from cli:
|
|
|
```
|
|
|
liquibase --driver=org.h2.Driver \
|
|
|
--classpath=$HOME/.m2/repository/com/h2database/h2/1.4.197/h2-1.4.197.jar \
|
|
|
--changeLogFile=migrations.yaml \
|
|
|
--url="jdbc:h2:./testdb" \
|
|
|
--username=sa \
|
|
|
--password="" \
|
|
|
--logLevel=debug \
|
|
|
update
|
|
|
``` |
|
|
\ No newline at end of file |