diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 5a2042a..b66de0f 100644
a
|
b
|
storage engine, you have a couple of options.
|
326 | 326 | |
327 | 327 | .. _AlterModelOnSyncDB: http://code.djangoproject.com/wiki/AlterModelOnSyncDB |
328 | 328 | |
| 329 | Table names |
| 330 | ----------- |
| 331 | |
| 332 | There are known issues in even the latest versions of MySQL that can cause the |
| 333 | case in a table name to be altered when certain SQL statements are executed |
| 334 | under certain conditions. It is recommended that you use lowercase table |
| 335 | names, if possible, to avoid any problems that might arise from this behavior. |
| 336 | Django uses lowercase table names when it auto-generates table names from |
| 337 | models, so this is mainly a consideration if you are overriding the table name |
| 338 | via the :class:`~django.db.models.Options.db_table` parameter. |
| 339 | |
329 | 340 | Notes on specific fields |
330 | 341 | ------------------------ |
331 | 342 | |
diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt
index 4530439..44b2b5b 100644
a
|
b
|
If your database table name is an SQL reserved word, or contains characters that
|
61 | 61 | aren't allowed in Python variable names -- notably, the hyphen -- that's OK. |
62 | 62 | Django quotes column and table names behind the scenes. |
63 | 63 | |
| 64 | .. admonition:: Use lowercase table names |
| 65 | |
| 66 | It is strongly advised that you use lowercase table names when you override |
| 67 | the table name via ``db_table``, particularly if you are using the MySQL |
| 68 | backend. See the :ref:`MySQL notes <mysql-notes>` for more details. |
| 69 | |
| 70 | |
64 | 71 | ``db_tablespace`` |
65 | 72 | ----------------- |
66 | 73 | |
diff --git a/tests/modeltests/unmanaged_models/models.py b/tests/modeltests/unmanaged_models/models.py
index bfbd544..00303cf 100644
a
|
b
|
class A01(models.Model):
|
12 | 12 | f_b = models.IntegerField() |
13 | 13 | |
14 | 14 | class Meta: |
15 | | db_table = 'A01' |
| 15 | db_table = 'a01' |
16 | 16 | |
17 | 17 | def __unicode__(self): |
18 | 18 | return self.f_a |
… |
… |
class B01(models.Model):
|
23 | 23 | f_b = models.IntegerField() |
24 | 24 | |
25 | 25 | class Meta: |
26 | | db_table = 'B01' |
| 26 | db_table = 'b01' |
27 | 27 | # 'managed' is True by default. This tests we can set it explicitly. |
28 | 28 | managed = True |
29 | 29 | |
… |
… |
class B01(models.Model):
|
31 | 31 | return self.f_a |
32 | 32 | |
33 | 33 | class C01(models.Model): |
34 | | mm_a = models.ManyToManyField(A01, db_table='D01') |
| 34 | mm_a = models.ManyToManyField(A01, db_table='d01') |
35 | 35 | f_a = models.CharField(max_length=10, db_index=True) |
36 | 36 | f_b = models.IntegerField() |
37 | 37 | |
38 | 38 | class Meta: |
39 | | db_table = 'C01' |
| 39 | db_table = 'c01' |
40 | 40 | |
41 | 41 | def __unicode__(self): |
42 | 42 | return self.f_a |
… |
… |
class A02(models.Model):
|
49 | 49 | f_a = models.CharField(max_length=10, db_index=True) |
50 | 50 | |
51 | 51 | class Meta: |
52 | | db_table = 'A01' |
| 52 | db_table = 'a01' |
53 | 53 | managed = False |
54 | 54 | |
55 | 55 | def __unicode__(self): |
… |
… |
class A02(models.Model):
|
57 | 57 | |
58 | 58 | class B02(models.Model): |
59 | 59 | class Meta: |
60 | | db_table = 'B01' |
| 60 | db_table = 'b01' |
61 | 61 | managed = False |
62 | 62 | |
63 | 63 | fk_a = models.ForeignKey(A02) |
… |
… |
class C02(models.Model):
|
75 | 75 | f_b = models.IntegerField() |
76 | 76 | |
77 | 77 | class Meta: |
78 | | db_table = 'C01' |
| 78 | db_table = 'c01' |
79 | 79 | managed = False |
80 | 80 | |
81 | 81 | def __unicode__(self): |
… |
… |
class Intermediate(models.Model):
|
86 | 86 | c02 = models.ForeignKey(C02, db_column="c01_id") |
87 | 87 | |
88 | 88 | class Meta: |
89 | | db_table = 'D01' |
| 89 | db_table = 'd01' |
90 | 90 | managed = False |
91 | 91 | |
92 | 92 | # |