Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fork of Liquibase MS SqlServer Extensions extension.

License

NotificationsYou must be signed in to change notification settings

sabomichal/liquibase-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central

liquibase-mssql

Fork of Liquibase MS SqlServer Extensions extension -https://liquibase.jira.com/wiki/display/CONTRIB/MS+SqlServer+Extensions.Pull requests welcome.

This fork adds following functionality:

  • it is Liquibase 3.x ready (currently supported version: 3.4.2)
  • supports stored procedures drop
  • wraps flagged calls toloadData with "set identity insert on" and "set identity insert off" - see sample
  • wraps flagged calls toinsert with "set identity insert on" and "set identity insert off" - see sample
  • adds support to createIndex for specifying included columns and fill-factor
  • adds support to addPrimaryKey for specifying fill-factor

Usage

To use, simply include the liquibase-mssql.jar file in your classpath. And add the ext namespace to your xml root node:

<databaseChangeLogxmlns="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">

Available changes/refactorings

Change: ‘insert’

Extends insert data changeset with identityInsertEnabled property.

New Attributes

identityInsertEnabled - boolean - when set to true, allows explicit values to be inserted into the identity column of a table.

Sample

<databaseChangeLogxmlns="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"><changeSetid="00000000000001"author="author"><createTabletableName="person"><columnname="id"autoIncrement="true"type="BIGINT"><constraintsnullable="false"primaryKey="true"primaryKeyName="pk_person_id"/></column><columnname="address"type="varchar(255)"/></createTable><ext:inserttableName="person"identityInsertEnabled="true"><columnname="id"valuenumeric="100" /><columnname="address"value="thing" /></ext:insert></changeSet></databaseChangeLog>

Change: ‘loadData’

Extends load data changeset with identityInsertEnabled property.

New Attributes

identityInsertEnabled - boolean - when set to true, allows explicit values to be inserted into the identity column of a table.

Sample

...<ext:loadDataencoding="UTF-8"file="classpath:config/liquibase/persons.csv"separator=";"tableName="person"identityInsertEnabled="true" />...

Change: 'createIndex'

Extends create index change with includedColumns and fillFactor properties. Properties clustered and descending are supported.

New attributes

includedColumns - string - columns to be included in index (comma separated if multiple)

fillFactor - int (1 to 100) - specifies a percentage that indicates how full the Database Engine should make the leaf level of each index page during index creation or rebuild

Sample

...<ext:createIndexindexName="IDX_first_name"tableName="person"includedColumns="id, last_name, dob"fillFactor="50">  <columnname="first_name" /></ext:createIndex>...

Change: 'addPrimaryKey'

Extends add primary key change with fillFactor property

New attribute

fillFactor - int (1 to 100) - specifies a percentage that indicates how full the Database Engine should make the leaf level of each index page during index creation or rebuild

Sample

...<ext:addPrimaryKeycolumnNames="id"constraintName="pk_mytable_id"tableName="mytable"fillFactor="70" />...

Refactoring: Changed check if table has an identity column

Changes identity column check not to use global tables to enable usage of multiple Liquibase instances simultaneously with the same database (but with different schemas)

About

Fork of Liquibase MS SqlServer Extensions extension.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp