civicrm/civicrm-core — pull request #3241 by pratik-joshi (2014-05-13 12:15:48+00:00)
Title: upgrade-fix : droping foriegn key for pdf_format_id of msg_template table (4.4.5 -> 4.5)

the issue:

4.5 upgrade consists of sql statement used for : dropping foreign key of pdf_format_id column of msg_template table and this is done by using 'FK_civicrm_msg_template_pdf_format_id' constraint name.

there is one scenario for this constraint name to be different i.e. 'pdf_format_id' : this is if the DB to be upgraded has been gone though 3.4.2 upgrade process execution (which consists of creation of pdf_format_id column). So, during this upgrade to 4.5, sql error is thrown as 'FK_civicrm_msg_template_pdf_format_id' doesn't exists.

the fix : checking the information schema for appropriate foreign key name and drop the key according.