diff --git a/composer.json b/composer.json index 24bd1d1..7ac14f7 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/src/TdbmFluidColumnOptions.php b/src/TdbmFluidColumnOptions.php index 50de35f..81ae8e5 100644 --- a/src/TdbmFluidColumnOptions.php +++ b/src/TdbmFluidColumnOptions.php @@ -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; } diff --git a/tests/TdbmFluidColumnOptionsTest.php b/tests/TdbmFluidColumnOptionsTest.php index 262043f..4017a14 100644 --- a/tests/TdbmFluidColumnOptionsTest.php +++ b/tests/TdbmFluidColumnOptionsTest.php @@ -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());