Fork of Liquibase MS SqlServer Extensions extension - https://liquibase.jira.com/wiki/display/CONTRIB/MS+SqlServer+Extensions.
This fork adds following functionality:
- it is Liquibase 3.x ready
- supports stored procedures drop
- wraps all calls to loadData with "set identity insert on" and "set identity insert off"
- wraps flagged calls to insert with "set identity insert on" and "set identity insert off" - see sample
To use, simply include the liquibase-mssql.jar file in your classpath. And add the ext namespace to your xml root node:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
Extends insert data changeset with identityInsertEnabled property.
identityInsertEnabled - boolean - when set to true, allows explicit values to be inserted into the identity column of a table.
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<createTable tableName="person">
<column name="id" autoIncrement="true" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="pk_person_id"/>
</column>
<column name="address" type="varchar(255)"/>
</createTable>
<ext:insert tableName="person" identityInsertEnabled="true">
<column name="id" valuenumeric="100" />
<column name="address" value="thing" />
</ext:insert>
</databaseChangeLog>
Extends create index change with includedColumns property
includedColumns - string - columns to be included in index (comma separated if multiple)
...
<ext:createIndex indexName="IDX_first_name" tableName="person" includedColumns="id, last_name, dob">
<column name="first_name" />
</ext:createIndex>
...