Skip to content

Commit 510aef1

Browse files
Added a fix ensuring attributes are merged correctly
1 parent ada4ce0 commit 510aef1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Table/Column.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,7 @@ public function render(AbstractColumn $column): void
140140

141141
if ($this->hasDefault() && $this->getDefault() !== null) {
142142
$column->defaultValue($this->getDefault());
143-
return;
144-
}
145-
146-
if ($this->hasOption(self::OPT_CAST_DEFAULT)) {
147-
// cast default value
143+
} elseif ($this->hasOption(self::OPT_CAST_DEFAULT)) {
148144
$column->defaultValue($this->castDefault($column));
149145
}
150146

tests/Schema/Driver/MySQL/ColumnTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testUnsignedColumnWithAdditionalAttributesAndDefault(): void
8686
$this->assertTrue($table->hasColumn('foo'));
8787
$this->assertArrayHasKey('comment', $table->column('foo')->getAttributes());
8888
$this->assertArrayHasKey('unsigned', $table->column('foo')->getAttributes());
89-
$this->assertFalse($table->column('foo')->getDefaultValue());
89+
$this->assertSame(0, $table->column('foo')->getDefaultValue());
9090
$this->assertSame($comment, $table->column('foo')->getAttributes()['comment']);
9191
$this->assertSame($comment, $table->column('foo')->getComment());
9292
$this->assertTrue($table->column('foo')->getAttributes()['unsigned']);

0 commit comments

Comments
 (0)