Skip to content

Commit 463b1e4

Browse files
Merge pull request #22 from josenicomaia/1.0
Added length option to Table::binary. It defaults to 255
2 parents ef50c64 + 04c5fc7 commit 463b1e4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Schema/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ public function softDeletes()
423423
*
424424
* @return \Doctrine\DBAL\Schema\Column
425425
*/
426-
public function binary($column)
426+
public function binary($column, $length = 255)
427427
{
428-
return $this->table->addColumn($column, Type::BINARY)->setNotnull(false);
428+
return $this->table->addColumn($column, Type::BINARY, compact('length'))->setNotnull(false);
429429
}
430430

431431
/**

tests/Schema/SchemaTableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function test_softdeletes()
273273
public function test_binary()
274274
{
275275
$column = m::mock(Column::class);
276-
$this->dbal->shouldReceive('addColumn')->with('column', 'binary')->andReturn($column);
276+
$this->dbal->shouldReceive('addColumn')->with('column', 'binary', ['length' => 255])->andReturn($column);
277277
$column->shouldReceive('setNotnull')->with(false)->once();
278278
$this->table->binary('column');
279279
}

0 commit comments

Comments
 (0)