public function build(array $options)
    {
        if (isset($options['fields'])) {
            if (!is_array($options['fields'])) {
                $message = 'Argument 1 passed to ' . __METHOD__ . ' must be an array.';
                throw new \InvalidArgumentException($message);
            }
            foreach ($options['fields'] as $id => $field_options) {
                $this->attachField(new SchemaField($id, $field_options));
            }
        }

        if (isset($options['unique_field'])) {
            $this->setUniqueField($options['unique_field']);
        }
    }