private function GetForeignKey($table, $field, &$constraintName, &$refTable, &$refField)
    {
        $sql = new Sql\Builder($this);

        $tbl = $sql->Table('information_schema.key_column_usage', array('TABLE_SCHEMA', 'TABLE_NAME', 'COLUMN_NAME',
            'CONSTRAINT_NAME', 'REFERENCED_TABLE_NAME', 'REFERENCED_COLUMN_NAME'));

        $cond = $sql->Equals($tbl->Field('TABLE_SCHEMA'), $sql->Value($this->dbName))
                ->And_($sql->Equals($tbl->Field('TABLE_NAME'), $sql->Value($table)))
                ->And_($sql->Equals($tbl->Field('COLUMN_NAME'), $sql->Value($field)))
                ->And_($sql->IsNotNull($tbl->Field('REFERENCED_TABLE_NAME')));

        $what = $sql->SelectList($tbl->Field('REFERENCED_TABLE_NAME'));
        $what->Add($tbl->Field('REFERENCED_COLUMN_NAME'));
        $what->Add($tbl->Field('CONSTRAINT_NAME'));
        $select = $sql->Select(true, $what, $tbl, $cond);
        $reader = $this->ExecuteQuery((string) $select);
        if ($reader->Read())
        {
            $constraintName = (string) $reader->ByName('CONSTRAINT_NAME');
            $refTable = (string) $reader->ByName('REFERENCED_TABLE_NAME');
            $refField = (string) $reader->ByName('REFERENCED_COLUMN_NAME');
            return true;
        }
        return false;
    }