Fixes #1286 SQL error while Upgrade
Merge pull request #1287 from JN-Jones/fix-1286

Fixes #1286 SQL error while Upgrade