File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
tests/Database/Table/bugs Expand file tree Collapse file tree 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)
7474 }
7575
7676 $ primary = $ this ->getPrimaryKey ($ table );
77- if (!$ primary || is_array ( $ primary ) ) {
77+ if (!$ primary ) {
7878 return NULL ;
7979 }
8080
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+ }
8486 }
8587 }
8688
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ test(function () use ($context) {
3838//Insert into table with composite primary key and one of them is auto_increment
3939test (function () use ($ context , $ driverName ) {
4040
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 ' ) {
4343 $ inserted = $ context ->table ('composite_pk_ai ' )->insert ([
4444 'id2 ' => 10 ,
4545 'name ' => 'Michal '
You can’t perform that action at this time.
0 commit comments