Adds support for postgres foreign keys

Works the same as the mysql FK implementation does