Check if column exists in mysql upgrade script

- if a column already exists, don't try to add it
- if the key of a value exists, don't insert it