mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 06:57:22 +08:00
upgrade do not change table field default value
This commit is contained in:
@@ -105,32 +105,32 @@ if ($currentStep == 3) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//Field invalid
|
//Field invalid
|
||||||
if ($fieldInfo['Null'] == 'NO' && $fieldInfo['Default'] === null && $fieldInfo['Key'] != 'PRI') {
|
// if ($fieldInfo['Null'] == 'NO' && $fieldInfo['Default'] === null && $fieldInfo['Key'] != 'PRI') {
|
||||||
$typePrefix = $fieldInfo['Type'];
|
// $typePrefix = $fieldInfo['Type'];
|
||||||
if (($pos = strpos($typePrefix, '(')) !== false) {
|
// if (($pos = strpos($typePrefix, '(')) !== false) {
|
||||||
$typePrefix = substr($typePrefix, 0, $pos);
|
// $typePrefix = substr($typePrefix, 0, $pos);
|
||||||
}
|
// }
|
||||||
if (preg_match('/varchar/', $typePrefix)) {
|
// if (preg_match('/varchar/', $typePrefix)) {
|
||||||
$tableRows[] = [
|
// $tableRows[] = [
|
||||||
'label' => "Field: $table.$field",
|
// 'label' => "Field: $table.$field",
|
||||||
'required' => "default ''",
|
// 'required' => "default ''",
|
||||||
'current' => 'null',
|
// 'current' => 'null',
|
||||||
'result' => 'NO',
|
// 'result' => 'NO',
|
||||||
];
|
// ];
|
||||||
$toAlterTable[$table][$field] = "modify $field {$fieldInfo['Type']} not null default ''";
|
// $toAlterTable[$table][$field] = "modify $field {$fieldInfo['Type']} not null default ''";
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
if (preg_match('/int/', $typePrefix)) {
|
// if (preg_match('/int/', $typePrefix)) {
|
||||||
$tableRows[] = [
|
// $tableRows[] = [
|
||||||
'label' => "Field: $table.$field",
|
// 'label' => "Field: $table.$field",
|
||||||
'required' => "default 0",
|
// 'required' => "default 0",
|
||||||
'current' => 'null',
|
// 'current' => 'null',
|
||||||
'result' => 'NO',
|
// 'result' => 'NO',
|
||||||
];
|
// ];
|
||||||
$toAlterTable[$table][$field] = "modify $field {$fieldInfo['Type']} not null default 0";
|
// $toAlterTable[$table][$field] = "modify $field {$fieldInfo['Type']} not null default 0";
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ($isPost) {
|
while ($isPost) {
|
||||||
|
|||||||
Reference in New Issue
Block a user