Replaced the pairs of foreign keys that reference and id and an application_id in another tabel with a single foreign key with a tuple of (id, application_id).
Fix for bug 3349052.
Authored by: jimwinston 2011-07-08
Parent: [r1016]
Child: [r1018]