File tree 2 files changed +8
-6
lines changed
tests/Database/Table/bugs
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,15 @@ public function getPrimaryKeySequence($table)
74
74
}
75
75
76
76
$ primary = $ this ->getPrimaryKey ($ table );
77
- if (!$ primary || is_array ( $ primary ) ) {
77
+ if (!$ primary ) {
78
78
return NULL ;
79
79
}
80
80
81
- foreach ($ this ->structure ['columns ' ][$ table ] as $ columnMeta ) {
82
- if ($ columnMeta ['name ' ] === $ primary ) {
83
- return isset ($ columnMeta ['vendor ' ]['sequence ' ]) ? $ columnMeta ['vendor ' ]['sequence ' ] : NULL ;
81
+ foreach ((array ) $ primary as $ key ) {
82
+ foreach ($ this ->structure ['columns ' ][$ table ] as $ columnMeta ) {
83
+ if ($ columnMeta ['name ' ] === $ key ) {
84
+ return isset ($ columnMeta ['vendor ' ]['sequence ' ]) ? $ columnMeta ['vendor ' ]['sequence ' ] : NULL ;
85
+ }
84
86
}
85
87
}
86
88
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ test(function () use ($context) {
38
38
//Insert into table with composite primary key and one of them is auto_increment
39
39
test (function () use ($ context , $ driverName ) {
40
40
41
- //Sqlite doesn't allow this type of table and sqlsrv's driver don't implement reflection, i don't know now why this not working in pgsql
42
- if ($ driverName == 'mysql ' ) {
41
+ //Sqlite doesn't allow this type of table and sqlsrv's driver don't implement reflection
42
+ if ($ driverName == 'mysql ' || $ driverName == ' pgsql ' ) {
43
43
$ inserted = $ context ->table ('composite_pk_ai ' )->insert ([
44
44
'id2 ' => 10 ,
45
45
'name ' => 'Michal '
You can’t perform that action at this time.
0 commit comments