Liquibase Mysql Includes

I’ve branched at https://github.com/carljoans/liquibase/tree/mysqlspecific
These are special considerations for MySQL which include the following:
– Fulltext Index for columns
– SQL escape. Escaping single quotes when generating csv data dump.
– Table Engine. MyISAM, InnoDB, etc. added to changlelog
– Column Datatype replicated exactly as created. ( i.e. int only went up to int(10) even though the column was created as int(11), double created as double(22) which generates an sql error, etc. )

Then there are some general changes that I just thought would be helpful to my specific projects:
– only create csv during data dump if there is data in table, instead of generating a csv for an empty table.
– Creating multiple changelog files at once
– Including or Excluding only certain tables in data or creation dump. Say if you want to export only specific tables. As per the previous point, you can put certain tables in one changelog and others in another and also ignore others completely. Useful if you have test tables or code generated tables you don’t want to include in your releases.

Some of the groovy tests need to be edited, .i.e remove some of the test cases, when building to ignore the changes. Or add the changes to the groovy tests where applicable.

If you submit it as a pull request, I can look at incorporating those changes into the main liquibase repository.

Nathan

Thanks, I’ll take a look in a bit. I’m currently working on finishing up 3.2.1 and then a large refactoring of the statement/statement generator logic. WHen that gets done I’m going to circle back around to the open pull requests.

I’ll probably look at breaking the changes up between core liquibase and a liquibase-mysql plugin for mysql-specific functionality as well.

Nathan

Request #277.
I made the changes because I needed liquibase to work for my specific needs, so there might be things I didn’t fully consider for broader use.
I’m satisfied with most of the changes, but there are a couple things worth pointing out:

– in liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java —> generateChangeSets()
     - Adding the modifySqlChange to add the engine type to the table is kind of a hack. You could probably find a better way to add the engine type to the table.
     - Also in the same method I only focused on getMissingObjects and didn’t think about the other two at that time.    

– I don’t remember the exact error, but I got an error reading

views after I made the changes. I think it is in  liquibase-core/src/main/java/liquibase/snapshot/JdbcDatabaseSnapshot.java – the getTables section. I haven’t had time to investigate yet.