From 3ebde412375a46a6987df4afbb891d15a3bf3615 Mon Sep 17 00:00:00 2001 From: Dorian Savina Date: Wed, 6 Jan 2021 16:24:06 +0100 Subject: [PATCH 1/2] revert parameter $indexName in column method `unique` Signed-off-by: Dorian Savina --- composer.json | 2 +- src/TdbmFluidColumnOptions.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; } From e42a0574cda10b4ba2ac3d62089c648c7c5adce7 Mon Sep 17 00:00:00 2001 From: Dorian Savina Date: Wed, 6 Jan 2021 16:22:44 +0100 Subject: [PATCH 2/2] Revert "[tests] update test case on `unique` method" This reverts commit a5e2a26bba8e6e3d8cd67b1e39539e2252ea9c40. --- tests/TdbmFluidColumnOptionsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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());