﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23101	Changing name of M2MField while db_table keeps table name unchanged leads to spurious migration that changes table name	maney@…	abraham.martin	"This is the terse version, I'm going to revisit this later as I think this and #22975 share similar root cause: using the apparent/default name and overlooking the db_table that actually sets the table's name.

In Model ""Some"", have a field like

    x = ManyToManyField(""Other"")       # table name app_some_x

Change that to

    x_set = ManyToManyField(""Other"", db_table=""app_some_x"")

which doesn't actually change anything in the schema, but the migration sees it as a rename of the intermediate table, generates a migration, and changes the name.  At this point you can observe in the shell that eg., Some.x_set.field.m2m_db_table() -> app_some_x, but the table in the database has been migrated to app_some_x_set.

(caveat: the above hasn't been tested per se, I'm summarizing to get this on record before I have to go.  Marked as 1.7, but while chatting with Andrew I did check it against master - no change.)"	Bug	closed	Migrations	1.7-rc-2	Release blocker	fixed			Accepted	0	0	0	0	0	0
