rework foreign key generator