Fixes #1081 Upgrade Issues
Fixes casting text to int on PgSQL
Merge pull request #1082 from JN-Jones/fix-1081-feature

Fixes #1081 Upgrade Issues