upgrade fix

dont try to access pulp if we dont actually need to
this allows migrations to work on fresh machines
during db population (and for tests)
defining repo model in migration
Merge pull request #1984 from jlsherrill/build_fix

upgrade fix