Fixed this for both implementations of _alter_many_to_many, instead of in `alter_db_table` itself (more implementations). Backport of 1edfa155e3 from master
1edfa155e3