Updated pgsql schema to include fk constraints