Bug 2986: add tests for migration 037
drop columns in a way that works on all supported DBs

Fixes #2986.
fix tests for foreign key from buildrequests to builders
Merge pull request #1316 from djmitche/bug2986

Update migration 037 and tests to work on Postgres

Fixes ticket:2986