@@ -1072,8 +1072,7 @@ protected function _attributeUnique(array &$attributes, array &$field)
10721072 */
10731073 protected function _attributeAutoIncrement (array &$ attributes , array &$ field )
10741074 {
1075- if (
1076- ! empty ($ attributes ['AUTO_INCREMENT ' ]) && $ attributes ['AUTO_INCREMENT ' ] === true
1075+ if (! empty ($ attributes ['AUTO_INCREMENT ' ]) && $ attributes ['AUTO_INCREMENT ' ] === true
10771076 && str_contains (strtolower ($ field ['type ' ]), 'int ' )
10781077 ) {
10791078 $ field ['auto_increment ' ] = ' AUTO_INCREMENT ' ;
@@ -1106,7 +1105,7 @@ protected function _processPrimaryKeys(string $table, bool $asQuery = false): st
11061105 $ sql .= 'CONSTRAINT ' . $ this ->db ->escapeIdentifiers (($ this ->primaryKeys ['keyName ' ] === '' ?
11071106 'pk_ ' . $ table :
11081107 $ this ->primaryKeys ['keyName ' ]))
1109- . ' PRIMARY KEY( ' . implode (', ' , $ this ->db ->escapeIdentifiers ($ this ->primaryKeys ['fields ' ])) . ') ' ;
1108+ . ' PRIMARY KEY( ' . implode (', ' , $ this ->db ->escapeIdentifiers ($ this ->primaryKeys ['fields ' ])) . ') ' ;
11101109 }
11111110
11121111 return $ sql ;
@@ -1210,6 +1209,10 @@ protected function _processIndexes(string $table, bool $asQuery = false): array
12101209 */
12111210 protected function _processForeignKeys (string $ table , bool $ asQuery = false ): array
12121211 {
1212+ if ($ this ->foreignKeys === []) {
1213+ return ['' ];
1214+ }
1215+
12131216 $ errorNames = [];
12141217
12151218 foreach ($ this ->foreignKeys as $ fkeyInfo ) {
@@ -1231,7 +1234,6 @@ protected function _processForeignKeys(string $table, bool $asQuery = false): ar
12311234 $ dbPrefix = $ this ->db ->DBPrefix ;
12321235 $ fkSuffix = $ isOci8 ? '_fk ' : '_foreign ' ;
12331236
1234- // Niezmienne fragmenty SQL przygotowane przed pętlą
12351237 $ prefixSql = $ asQuery
12361238 ? 'ALTER TABLE ' . $ this ->db ->escapeIdentifiers ($ dbPrefix . $ table ) . ' ADD '
12371239 : ", \n\t" ;
0 commit comments