adding foreign key generation