Need to modify dbmaintain script to handle mysql syntax change
We use dbmaintain to help automate sql table maintenance in our web service project. I just ran in开发者_如何学运维to a tricky issue where an upgrade to version 5.5.8 of mysql resulted in a syntax change that broke an existing script due to the use of 'type' where 'engine' is now required in a 'create_table' command.
Ordinarily, without dbmaintain, it would be pretty simple to fix this since the 'engine' syntax will work on older versions of mysql. However, in the world of dbmaintain, changing an incremental script is forbidden. Is there a clean, acceptable way to handle this issue within the constraints of dbmaintain? I'm thinking of just deleting the existing script and putting one in that has the right syntax - it turns out that the script is more or less independent from the others in its folder, so it won't matter in what order it gets run.
If you want to manually tweak this script and ensure DbMaintain ignores it, you should update the DB_MAINTAIN table with the updated hashes. The easiest way to do this would be to take the new hash and update your production CHECKSUM column. You may also need to play around with the FILE_LAST_MODIFIED_AT column.
You can source the updated checksum from a DB_MAINTAIN table running in a "from scratch" database.
精彩评论