Skip to content

Instantly share code, notes, and snippets.

@goyalmohit
Created March 4, 2019 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalmohit/96351f01cfbf884033e49493b8f62428 to your computer and use it in GitHub Desktop.
Save goyalmohit/96351f01cfbf884033e49493b8f62428 to your computer and use it in GitHub Desktop.
Add a new column in existing table customerdetails using preconditions in liquibase
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="mohitgoyal" id="20190304223500">
<preConditions onFail="HALT">
<tableExists schemaName="dbo" tableName="CustomerDetails"/>
</preConditions>
<addColumn schemaName="dbo" tableName="CustomerDetails">
<column name="CustomerAddress" type="varchar(255)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment