fix app migrations to work with a blank db
Merge pull request #5122 from dimagi/app-migration-bootstrap

fix app migrations to work with a blank db