Skip to content

Commit

Permalink
Merge pull request #21 from dsavina/feature/optional-index-name
Browse files Browse the repository at this point in the history
Revert parameter `$indexName` for column method `unique`
  • Loading branch information
moufmouf authored Jan 6, 2021
2 parents 64d63f6 + e42a057 commit 1aacb60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": ">=7.1",
"thecodingmachine/dbal-fluid-schema-builder": "^1.6",
"thecodingmachine/dbal-fluid-schema-builder": "^1.6.1",
"doctrine/dbal": "^2.5"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions src/TdbmFluidColumnOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function null(): self
*
* @return self
*/
public function unique(?string $indexName = null): self
public function unique(): self
{
$this->fluidColumnOptions->unique($indexName);
$this->fluidColumnOptions->unique();
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/TdbmFluidColumnOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function testOptions()
$columnOptions->notNull();
$this->assertSame(true, $dbalColumn->getNotnull());

$columnOptions->unique('unique_foo');
$this->assertSame(true, $posts->getDbalTable()->getIndex('unique_foo')->isUnique());
$columnOptions->unique();
$this->assertSame(true, $dbalColumn->getCustomSchemaOption('unique'));

$columnOptions->comment('foo');
$this->assertSame('foo', $dbalColumn->getComment());
Expand Down

0 comments on commit 1aacb60

Please sign in to comment.