[1.7.x] Fixed #23956 -- Fixed migration creation for multiple table inheritance

Backport of 44927ba817a4ecf9834d429ff6c86bc5ac961305 from master