Replaced method name setForeignKey with setConstraint