Fix some weird bugs in product migrations

- Use of SQLProduct vs orm.SQLProduct caused problems when running
migrations from a later state.

- Due to poor behavior during development, the auto generated orm table
  definitions in the migration files 0006 and 0007 were out of date and
  this caused fun new problems.
Merge pull request #4577 from dimagi/fix-weird-tests

Fix some weird bugs in product migrations