fixed relationship mapping bug, now foreign keys are generated properly