Changeset 37938 for branches/4.3/src/wp-admin/includes/upgrade.php
- Timestamp:
- 07/01/2016 11:41:57 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.3/src/wp-admin/includes/upgrade.php
r33950 r37938 2063 2063 $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries ); 2064 2064 2065 $text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' ); 2066 $blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' ); 2067 2065 2068 $global_tables = $wpdb->tables( 'global' ); 2066 2069 foreach ( $cqueries as $table => $qry ) { … … 2132 2135 // Is actual field type different from the field type in query? 2133 2136 if ($tablefield->Type != $fieldtype) { 2137 $do_change = true; 2138 if ( in_array( strtolower( $fieldtype ), $text_fields ) && in_array( strtolower( $tablefield->Type ), $text_fields ) ) { 2139 if ( array_search( strtolower( $fieldtype ), $text_fields ) < array_search( strtolower( $tablefield->Type ), $text_fields ) ) { 2140 $do_change = false; 2141 } 2142 } 2143 2144 if ( in_array( strtolower( $fieldtype ), $blob_fields ) && in_array( strtolower( $tablefield->Type ), $blob_fields ) ) { 2145 if ( array_search( strtolower( $fieldtype ), $blob_fields ) < array_search( strtolower( $tablefield->Type ), $blob_fields ) ) { 2146 $do_change = false; 2147 } 2148 } 2149 2150 if ( $do_change ) { 2134 2151 // Add a query to change the column type 2135 $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; 2136 $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; 2152 $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; 2153 $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; 2154 } 2137 2155 } 2138 2156
Note: See TracChangeset
for help on using the changeset viewer.