Fix custom_fields errors in other/upgrade_2-1*.sql files
More upgrade sql script fixes

Signed-off-by: Noteworthy Software, Inc <online@noteworthysoftware.com>
Fix attachment rename processing in upgrade_2-1_mysql.sql

Signed-off-by: Noteworthy Software, Inc <online@noteworthysoftware.com>
Merge pull request #1466 from nwsw/upgradefix

Oh well, fine...  I'm going to merge this, even though it will mean more work for us (like I already said, we are AWARE of the issues and solved them already, now we will have to re-do our code) and this isn't something critical, I'm pretty sure the install/upgrade will continue to get errors as we add more stuff to it, its only natural since we aren't even on alpha stage.
Thank you for your contribution.