Imagine i had a table ‘some-table’ that i want to create in multiple schemas. File called ‘create-some-table.yaml’
databaseChangeLog:
- changeSet:
id: create-some-table
runOnChange: true
author: gimazov (generated)
preConditions:
- onFail: MARK_RAN
not:
tableExists:
tableName: some-table
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: some-table_pkey
name: id
type: BIGINT
tableName: some-table
schemaName: ${schema}
Then there’s a yaml file ‘schema1.yaml’ that includes the previous file and sets schema
databaseChangeLog:
- property:
name: schema
value: schema1
- include:
file: classpath:/db/changelog/create-some-table.yaml
Then the same file as the above one just named ‘schema2.yaml’ with corresponding schema name
The last thing is changelog-master which is pretty simple
databaseChangeLog:
- include:
file: classpath:/db/changelog/schema1.yaml
- include:
file: classpath:/db/changelog/schema2.yaml
Is there any way i can do something similar to this, thanks