﻿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
12810	Add validation for clashing ManyToManyField.db_table names	strelnikovdmitrij	Berker Peksag	"Originally from documentation.
ManyToManyField.db_table
The name of the table to create for storing the many-to-many data. If this is not provided, Django will assume a default name based upon the names of the two tables being joined.

It is a little bit unclear, cause if db_table is not provided, Django will create table with name based on the name of the model (table that has the ManyToManyField), and field name that contain this ManyToManyField.
{{{
class Product(models.Model):
 color = models.ManyToManyField('ProductColor', null=True, blank=True)
 class Meta:
  db_table = 'eshop_product'

class ProductColor(models.Model):
 name = ...
 class Meta:
  db_table = 'eshop_product_color'
}}}
running syncdb
after the creation of 'eshop_product' table Django will create 'eshop_product_color' table that holds relation between Product and ProductColor. The table for ProductColor will never create."	Bug	closed	Core (System checks)	dev	Normal	fixed	ManyToManyField	berker.peksag@…	Ready for checkin	1	0	0	0	0	0
