db2 driver updates
This commit is contained in:
@@ -141,6 +141,9 @@ class Db2SchemaGrammar extends Grammar
|
||||
return $schema === null ? $this->wrapValue($name) : $this->wrapValue($schema).'.'.$this->wrapValue($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile a Db2 column declaration for CREATE TABLE or ADD COLUMN.
|
||||
*/
|
||||
private function columnDefinition(Fluent $column): string
|
||||
{
|
||||
$sql = $this->wrap($column).' '.$this->getType($column);
|
||||
@@ -151,7 +154,9 @@ class Db2SchemaGrammar extends Grammar
|
||||
if (! $column->nullable) {
|
||||
$sql .= ' NOT NULL';
|
||||
}
|
||||
if ($column->default !== null) {
|
||||
if ($column->useCurrent && in_array($column->type, ['timestamp', 'dateTime'], true)) {
|
||||
$sql .= ' DEFAULT CURRENT TIMESTAMP';
|
||||
} elseif ($column->default !== null) {
|
||||
$sql .= ' DEFAULT '.$this->getDefaultValue($column->default);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user