simplify code

This commit is contained in:
Dieter Adriaenssens 2012-08-31 13:53:20 +02:00
parent 3a17a439f5
commit 3eda5eccf5

View File

@ -266,16 +266,17 @@ foreach ($fields as $row) {
// MySQL 4.1.2+ TIMESTAMP options
// (if on_update_current_timestamp is set, then it's TRUE)
if (isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) {
$tempField = $analyzed_sql[0]['create_table_fields'][$row['Field']];
if (isset($tempField['on_update_current_timestamp'])) {
$attribute = 'on update CURRENT_TIMESTAMP';
}
// here, we have a TIMESTAMP that SHOW FULL COLUMNS reports as having the
// NULL attribute, but SHOW CREATE TABLE says the contrary. Believe
// the latter.
if (! empty($analyzed_sql[0]['create_table_fields'][$row['Field']]['type'])
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP'
&& $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null']
if (! empty($tempField['type'])
&& $tempField['type'] == 'TIMESTAMP'
&& $tempField['timestamp_not_null']
) {
$row['Null'] = '';
}