Liquibase generateChangeLog does not output schema

When writing a changeSet to create a table, you can specify the table schema (see here )

If I run

liquibase generateChangeLog

      

The output contains no schema.

For reference, here's the Liquibase.properties file I'm using:

driver: org.h2.Driver
classpath: h2-1.4.181.jar
url: jdbc:h2:~/test.db
username: sa
password: sa
changeLogFile: baseline.xml
liquibaseCatalogName: LIQUIBASE
liquibaseSchemaName: BAR
defaultSchemaName: BAR
outputDefaultSchema: true
outputDefaultCatalog: true

      

Output for one of the tables:

<createTable tableName="PRODUCTS">
  <column name="ID" type="INT(10)"/>
  <column name="CODE" type="VARCHAR(10)"/>
  <column name="PRICE" type="DECIMAL(9, 2)"/>
</createTable>

      

If I wrote this by hand, I would include the schema:

<createTable schemaName="BAR" tableName="PRODUCTS">
  <column name="ID" type="INT(10)"/>
  <column name="CODE" type="VARCHAR(10)"/>
  <column name="PRICE" type="DECIMAL(9, 2)"/>
</createTable>

      

Is it by design? I am fine using XSLT after the fact.

+3


source to share


2 answers


Use the flag --includeCatalog=true

after generateChangeLog. For example:liquibase generateChangeLog --includeCatalog=true



OutputDefaultSchema is only used if the generateChangeLog is to include schema information in the first place.

+2


source


Please use outputDefaultSchema=true

. This will print the name of the schema in the changeset. When using maven plugin use<outputDefaultSchema>true</outputDefaultSchema>



0


source







All Articles