Skip to content

Commit 576397a

Browse files
committed
fix: make default NULL when modifying column
1 parent 12b6d45 commit 576397a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

system/Database/SQLite3/Forge.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ protected function _alterTable(string $alterType, string $table, $processedField
141141
$field['name'] = $name;
142142
$field['new_name'] = $newName;
143143

144+
// Unlike when creating a table, if `null` is not specified,
145+
// the column will be `NULL`, not `NOT NULL`.
146+
if ($processedField['null'] === '') {
147+
$field['null'] = true;
148+
}
149+
144150
$fieldsToModify[] = $field;
145151
}
146152

0 commit comments

Comments
 (0)