Use correct sql types for primary keys

PostgreSQL is strict about the sql type matching that of the columns
Merge branch 'master' of git://github.com/sebduggan/BugLogHQ into sebduggan-master