HABTM to HMT migration