Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

Summary

Uses pt-online-schema-change in order to add or drop columns.

Current Version

1.0.0

Author

Andreas Dangel (adangel [at] users.sf.net)

Issue Tracking

https://github.com/adangel/liquibase-percona/issues

Source Repository

https://github.com/adangel/liquibase-percona.git

Maven Coordinates

com.github.adangel.liquibase.ext:liquibase-percona

Supported Database

MySQL

 

More Information,  see Readme on github: https://github.com/adangel/liquibase-percona/blob/master/README.md

 

News

October 19, 2014

1.0.0

 

...

News

October 19, 2014

1.0.0

 

Attachments

Readme

Supported Databases

MySQL is the only supported database. The extension checks whether it is being run against a MySQL database. If not, it falls back to the default AddColumn/DropColumn change of liquibase-core.

Liquibase version(s) tested against

Liquibase 3.2.0

Example

This changeset

Code Block
languagexml
<changeSet id="2" author="Alice">
    <addColumn tableName="person">
        <column name="address" type="varchar(255)"/>
    </addColumn>
</changeSet>

will execute the following command:

pt-online-schema-change --alter="ADD COLUMN address VARCHAR(255)" --host=127.0.0.1 --port=3306 --user=root --password=** --execute D=testdb,t=person

Configuration

The extension supports the following java system properties:

Notes

The non-locking update is achieved using triggers. First a new temporary table is created, including the added or dropped columns. Then the data is copied in chunks. While to copy is in progress, any newly created or deleted or updated rows are copied, too. This is done by adding triggers to the original table. After the copy is finished, the original table is dropped and the temporary table is renamed.

This means, that pt-online-schema-change cannot be used, if the table already uses triggers.

The command pt-online-schema-change is searched only on the PATH.

Building this extension

Simply run mvn clean install.

In order to execute the integration tests, run mvn clean install -Prun-its. Please note, that a MySQL server/Percona server is needed. See the properties config_... in pom.xml for connection details.

References