Generated foreign keys and fixed index issue of fk

Some small fixes:
1. Changed data type of position to Short
2. Added the logic to handle fk constraint name doesn't match its index
name.
3. Exposed getIndexBuilderSet method to help fix 2.