Skip to content

Commit 33a1d61

Browse files
authored
Merge pull request #115 from tailflow/next
v2.1.4 Release
2 parents 07b6465 + 2a3f5de commit 33a1d61

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Specs/Builders/PropertyBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function build(Column $column, string $concretePropertyClass): SchemaProp
2020
/** @var SchemaProperty $property */
2121
$property = new $concretePropertyClass();
2222
$property->name = $column->getName();
23+
$property->nullable = !$column->getNotnull();
2324

2425
return $property;
2526
}

src/ValueObjects/Specs/Schema/SchemaProperty.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ class SchemaProperty implements Arrayable
1212
public $name;
1313
/** @var string */
1414
public $type;
15+
/** @var bool */
16+
public $nullable = false;
1517

1618
public function toArray(): array
1719
{
18-
return [
20+
$descriptor = [
1921
'type' => $this->type,
2022
];
23+
24+
if ($this->nullable) {
25+
$descriptor['nullable'] = true;
26+
}
27+
28+
return $descriptor;
2129
}
2230
}

0 commit comments

Comments
 (0)