Make WordPress Core


Ignore:
Timestamp:
09/21/2025 03:50:56 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Database: Do not unnecessarily alter table in dbDelta() for field type case differences.

This aims to avoid extra changes to database structure when type case is the only difference:

Changed type of wp_table.field from varchar(255) to VARCHAR(255)

Follow-up to [1575], [37532].

Props leewillis77, tristanleboss, lordspace, johnbillion, SergeyBiryukov.
Fixes #59481.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r60784 r60789  
    32043204
    32053205                // Is actual field type different from the field type in query?
    3206                 if ( $tablefield->Type !== $fieldtype ) {
     3206                if ( $tablefield->Type !== $fieldtype_lowercased ) {
    32073207                    $do_change = true;
    32083208                    if ( in_array( $fieldtype_lowercased, $text_fields, true ) && in_array( $tablefield_type_lowercased, $text_fields, true ) ) {
Note: See TracChangeset for help on using the changeset viewer.