Added missing check for needed database update
Added proposed changes for easier diff and added constant for mysql error
Fixed indentation error.