MCPcopy
hub / github.com/django/django / max_name_length

Method max_name_length

django/contrib/postgres/indexes.py:19–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17class PostgresIndex(CheckPostgresInstalledMixin, Index):
18 @cached_property
19 def max_name_length(self):
20 # Allow an index name longer than 30 characters when the suffix is
21 # longer than the usual 3 character limit. The 30 character limit for
22 # cross-database compatibility isn't applicable to PostgreSQL-specific
23 # indexes.
24 return Index.max_name_length - len(Index.suffix) + len(self.suffix)
25
26 def create_sql(self, model, schema_editor, using="", **kwargs):
27 self.check_supported(schema_editor)

Calls

no outgoing calls