File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 10
10
],
11
11
"require" : {
12
12
"php" : " >=7.1" ,
13
- "thecodingmachine/dbal-fluid-schema-builder" : " ^1.4 " ,
13
+ "thecodingmachine/dbal-fluid-schema-builder" : " ^1.6 " ,
14
14
"doctrine/dbal" : " ^2.5"
15
15
},
16
16
"require-dev" : {
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ public function null(): self
51
51
*
52
52
* @return self
53
53
*/
54
- public function unique (): self
54
+ public function unique (? string $ indexName = null ): self
55
55
{
56
- $ this ->fluidColumnOptions ->unique ();
56
+ $ this ->fluidColumnOptions ->unique ($ indexName );
57
57
return $ this ;
58
58
}
59
59
@@ -62,9 +62,9 @@ public function unique(): self
62
62
*
63
63
* @return self
64
64
*/
65
- public function index (): self
65
+ public function index (? string $ indexName = null ): self
66
66
{
67
- $ this ->fluidColumnOptions ->index ();
67
+ $ this ->fluidColumnOptions ->index ($ indexName );
68
68
return $ this ;
69
69
}
70
70
public function comment (string $ comment ): self
Original file line number Diff line number Diff line change @@ -42,15 +42,15 @@ public function column(string $name): TdbmFluidColumn
42
42
return $ this ->tdbmFluidColumns [$ name ];
43
43
}
44
44
45
- public function index (array $ columnNames ): TdbmFluidTable
45
+ public function index (array $ columnNames, ? string $ indexName = null ): TdbmFluidTable
46
46
{
47
- $ this ->fluidTable ->index ($ columnNames );
47
+ $ this ->fluidTable ->index ($ columnNames, $ indexName );
48
48
return $ this ;
49
49
}
50
50
51
- public function unique (array $ columnNames ): TdbmFluidTable
51
+ public function unique (array $ columnNames, ? string $ indexName = null ): TdbmFluidTable
52
52
{
53
- $ this ->fluidTable ->unique ($ columnNames );
53
+ $ this ->fluidTable ->unique ($ columnNames, $ indexName );
54
54
return $ this ;
55
55
}
56
56
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ public function testOptions()
26
26
$ columnOptions ->notNull ();
27
27
$ this ->assertSame (true , $ dbalColumn ->getNotnull ());
28
28
29
- $ columnOptions ->unique ();
30
- $ this ->assertSame (true , $ dbalColumn -> getCustomSchemaOption ( ' unique ' ));
29
+ $ columnOptions ->unique (' unique_foo ' );
30
+ $ this ->assertSame (true , $ posts -> getDbalTable ()-> getIndex ( ' unique_foo ' )-> isUnique ( ));
31
31
32
32
$ columnOptions ->comment ('foo ' );
33
33
$ this ->assertSame ('foo ' , $ dbalColumn ->getComment ());
You can’t perform that action at this time.
0 commit comments