public function addField($model, $field)
    {
        // many to many
        if ($field->manyToMany && $field->relation->through->getMeta()->autoCreated) {
            $this->createModel($field->relation->through);

            return;
        }
        $type = $field->dbType($this->connection);
        $name = $field->getColumnName();
        $fieldOptions = $this->getDoctrineColumnOptions($field, true);
        // It might not actually have a column behind it
        if (empty($type)) {
            return;
        }

        $tableDef = new TableDiff($model->getMeta()->getDbTable());
        // normal column
        $tableDef->addedColumns[] = new Column(
            $name,
            Type::getType($type),
            $fieldOptions
        );
        // unique constraint
        if ($field->primaryKey) {
            $tableDef->addedIndexes[] = new Index(
                'primary',
                [$name],
                true,
                true
            );
        }
        // unique constraint
        if ($field->isUnique() && !$field->primaryKey) {
            $tableDef->addedIndexes[] = new Index(
                sprintf('uniq_%s_%s', mt_rand(1, 1000), $name),
                [$name],
                true
            );
        }
        // index constraint
        if ($field->dbIndex && !$field->isUnique() && !$field->primaryKey) {
            $tableDef->addedIndexes[] = new Index(
                sprintf('idx_%s_%s', mt_rand(1, 1000), $name),
                [$name]
            );
        }

        // we need to drop in-database defaults
        if ($this->effectiveDefault($field)) {
            //todo
        }

        /* @var $field ForeignKey */
        if ($field->isRelation && $field->relation && $field->dbConstraint) {
            $relField = $field->getRelatedField();

            $tableDef->addedForeignKeys[] = new ForeignKeyConstraint(
                [$field->getColumnName()],
                $relField->scopeModel->getMeta()->getDbTable(),
                [$relField->getColumnName()]
            );
        }

        $this->alterTable($tableDef);
    }