ghost

Online migration with gh-ost integrated with tools like flyway/liquibase


I've been investigating how to use gh-ost and it seems that is not yet integrated with tools like flyway/liquibase. gh-ost has to be run like this:

./gh-ost --host=XXX--user=XXXX--password=XXXX--database=XXX--table=XXX --alter="ADD COLUMN XXX INT NOT NULL DEFAULT '0'"

It seems that the table name and the "alter" sql commands are part of gh-ost command parameters.

Is there any way I can use gh-ost benefits(online schema migration) with what a tool like flyway/liquibase has to offer?


Solution

  • It doesn't look trivial. With Flyway, you could use the Custom Migration resolvers & executors to wrap special files in the gh-ost command. For a proof-of-concept you could use a java class migration to call out to the operating system to run the Gh-ost command.