Error when upgrading from 4.7.16 to 4.7.20
It appears that the foreign key mentioned in the error message doesn't exist for some reason. I would probably go into MySQL and check.  If it's not there, just create one with the same name on the civicrm_case table. Then try the upgrade again.

A MySQL statement to create the foreign key (from CiviCRM 4.5) is: ADD CONSTRAINT FK_civicrm_case_case_type_id FOREIGN KEY (case_type_id) REFERENCES civicrm_case_type (id) ON DELETE SET NULL;