|
@@ 2368-2372 (lines=5) @@
|
| 2365 |
|
} |
| 2366 |
|
} |
| 2367 |
|
|
| 2368 |
|
if ( $do_change ) { |
| 2369 |
|
// Add a query to change the column type. |
| 2370 |
|
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN `{$tablefield->Field}` " . $cfields[ $tablefield_field_lowercased ]; |
| 2371 |
|
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; |
| 2372 |
|
} |
| 2373 |
|
} |
| 2374 |
|
|
| 2375 |
|
// Get the default value from the array. |
|
@@ 2378-2382 (lines=5) @@
|
| 2375 |
|
// Get the default value from the array. |
| 2376 |
|
if ( preg_match( "| DEFAULT '(.*?)'|i", $cfields[ $tablefield_field_lowercased ], $matches ) ) { |
| 2377 |
|
$default_value = $matches[1]; |
| 2378 |
|
if ($tablefield->Default != $default_value) { |
| 2379 |
|
// Add a query to change the column's default value |
| 2380 |
|
$cqueries[] = "ALTER TABLE {$table} ALTER COLUMN `{$tablefield->Field}` SET DEFAULT '{$default_value}'"; |
| 2381 |
|
$for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}"; |
| 2382 |
|
} |
| 2383 |
|
} |
| 2384 |
|
|
| 2385 |
|
// Remove the field from the array (so it's not added). |