src/Database/Migration/Generator/MySqlGenerator.php
protected function getAlternatePrimaryKeys($table)
    {
        $alternatePrimaryKey = false;
        $primaryKeys = [];
        foreach ($table['columns'] as $column) {
            $columnName = $column['COLUMN_NAME'];
            $columnKey = $column['COLUMN_KEY'];
            if ($columnKey !== 'PRI') {
                continue;
            }
            if ($columnName !== 'id') {
                $alternatePrimaryKey = true;
            }
            $primaryKeys[] = '"' . $columnName . '"';
        }
        if ($alternatePrimaryKey) {
            return $primaryKeys;
        }

        return null;
    }
protected function getAlternatePrimaryKeys($table)
    {
        $alternatePrimaryKey = false;
        $primaryKeys = [];
        foreach ($table['columns'] as $column) {
            $columnName = $column['COLUMN_NAME'];
            $columnKey = $column['COLUMN_KEY'];
            if ($columnKey !== 'PRI') {
                continue;
            }
            if ($columnName !== 'id') {
                $alternatePrimaryKey = true;
            }
            $primaryKeys[] = '"' . $columnName . '"';
        }
        if ($alternatePrimaryKey) {
            return $primaryKeys;
        }

        return null;
    }
protected function getAlternatePrimaryKeys ( $ table ) { $ alternatePrimaryKey = false ; $ primaryKeys = [ ] ; foreach ( $ table [ 'columns' ] as $ column ) { $ columnName = $ column [ 'COLUMN_NAME' ] ; $ columnKey = $ column [ 'COLUMN_KEY' ] ; if ( $ columnKey !== 'PRI' ) { continue ; } if ( $ columnName !== 'id' ) { $ alternatePrimaryKey = true ; } $ primaryKeys [ ] = '"' . $ columnName . '"' ; } if ( $ alternatePrimaryKey ) { return $ primaryKeys ; } return null ; }
Collect alternate primary keys

@param array $table

@return array|null
Collect alternate primary keys