Intermediate version for adding sql index to foreign keys