mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #30397 -- Added app_label/class interpolation for names of indexes and constraints.
This commit is contained in:
parent
8233144ca0
commit
febe136d4c
9 changed files with 166 additions and 11 deletions
|
@ -55,9 +55,15 @@ than 30 characters and shouldn't start with a number (0-9) or underscore (_).
|
|||
cannot normally specify a partial index on an abstract base class, since
|
||||
the :attr:`Meta.indexes <django.db.models.Options.indexes>` option is
|
||||
inherited by subclasses, with exactly the same values for the attributes
|
||||
(including ``name``) each time. Instead, specify the ``indexes`` option
|
||||
on subclasses directly, providing a unique name for each index.
|
||||
(including ``name``) each time. To work around name collisions, part of the
|
||||
name may contain ``'%(app_label)s'`` and ``'%(class)s'``, which are
|
||||
replaced, respectively, by the lowercased app label and class name of the
|
||||
concrete model. For example ``Index(fields=['title'],
|
||||
name='%(app_label)s_%(class)s_title_index')``.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Interpolation of ``'%(app_label)s'`` and ``'%(class)s'`` was added.
|
||||
|
||||
``db_tablespace``
|
||||
-----------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue