persistent-postgresql: Produce correct alter table statements for non-primary foreign references

This is the fix for #166 with the new schema query and `nub`ing of the resulting migrations