Liquibase - XML Template - AddColumn

The website gives this as an example to add a column using XML

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<changeSet author="liquibase-docs" id="addColumn-example">
<addColumn
catalogName="notes"
schemaName= "dbo"
tableName="notes">
<column name="CompanyKey"
type="varchar(255)">
<constraints nullable="false" />
</column>
<column name="ApplicationSubKey"
type="varchar(255)">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>

Here’s what I understand

  • This sample adds two columns to the notes table
  • author - for me I use ‘wachdorfm’
  • id - I use my ticket number
  • catalogName - this is the name of the database
  • schemaName - this is the schema
  • tableName - this is the name of the table getting a key
  • column - this starts the information of the column we are trying to add
  • type - data type for that column
  • constraints - addtional attributes for that column.