protected function findOuter(SchemaBuilder $builder)
    {
        foreach ($this->findTargets($builder) as $schema) {
            $outerTable = $builder->requestTable($schema->getTable(), $schema->getDatabase());
            $outerKey = $this->option(Record::OUTER_KEY);

            if ($outerKey == ORMInterface::R_PRIMARY_KEY) {
                $outerKey = current($outerTable->getPrimaryKeys());
            }

            if (!$outerTable->hasColumn($outerKey)) {
                throw new RelationSchemaException(sprintf("Outer key '%s'.'%s' (%s) does not exists",
                    $outerTable->getName(),
                    $outerKey,
                    $this->getDefinition()->getName()
                ));
            }

            return $outerTable->column($outerKey);
        }

        return null;
    }