Skip to content

Commit

Permalink
fix: make default NULL when modifying column
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jan 26, 2024
1 parent 12b6d45 commit 576397a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/Database/SQLite3/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ protected function _alterTable(string $alterType, string $table, $processedField
$field['name'] = $name;
$field['new_name'] = $newName;

// Unlike when creating a table, if `null` is not specified,
// the column will be `NULL`, not `NOT NULL`.
if ($processedField['null'] === '') {
$field['null'] = true;
}

$fieldsToModify[] = $field;
}

Expand Down

0 comments on commit 576397a

Please sign in to comment.