Change method name for pgsql driver's ensureIdentifiersLength() to accurately describe what the method is doing

Created on 14 February 2015, almost 10 years ago
Updated 24 July 2023, over 1 year ago

Problem/Motivation

Follow-up from #2425127: Prevent PostgreSQL from creating duplicated index names within schema β†’ . The method name ensureIdentifiersLength does not document what it does accurately and should be renamed accordingly.

  /** 
   * Make sure to limit identifiers according to PostgreSQL compiled in length.
   *
   * PostgreSQL allows in standard configuration no longer identifiers than 63
   * chars for table/relation names, indexes, primary keys, and constraints. So
   * we map all identifiers that are too long to drupal_base64hash_tag, where
   * tag is one of:
   *   - idx for indexes
   *   - key for constraints
   *   - pkey for primary keys
   *
   * @param $identifiers
   *   The arguments to build the identifier string
   * @return
   *   The index/constraint/pkey identifier
   */
  protected function ensureIdentifiersLength($identifier) {

Proposed resolution

Rename the method to "hashIdentifierLength" and update the use of that method throughout core.

Remaining tasks

User interface changes

None.

API changes

Yes. However this is an internal protected method for pgsql driver.

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->
πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
PostgreSQL driverΒ  β†’

Last updated 10 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States mradcliffe USA

Live updates comments and jobs are added and updated live.
  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024