Fix foreign key in postgresql schema