protected function create()
    {
        $fields = [];
        $keys = [];

        foreach ($this->getCurrentTable()->getFields() as $name => $field) {
            $fields[] = implode(' ', [
                '`' . $field->getName() . '`',
                $field->getType() . '(' . $field->getLength() . ')',
                ($field->isUnsigned()) ? 'UNSIGNED' : '',
                ($field->isNullable() ? '' : ('NOT NULL')),
                (!$field->isIncrement() && !$field->isUnique() && !$field->isPrimary() ? 'DEFAULT "' . $field->getDefault() . '"' : '') ,
                ($field->isIncrement()) ? 'AUTO_INCREMENT' : '',
                'COMMENT "' . $field->getComment() . '"'
            ]);

            if (null !== $field->getKey()) {
                if ($field->isPrimary()) {
                    $keys[] = 'PRIMARY KEY (`' . $field->getName() . '`)';
                } else if ($field->isUnique()) {
                    $keys[] = 'UNIQUE KEY `unique_' . $field->getName() . '` (`' . $field->getName() . '`)';
                } else if ($field->isIndex()) {
                    $keys[] = 'KEY `index_' . $field->getName() . '` (`' . $field->getName() . '`)';
                }
            }

            $this->setCacheField($field);
        }

        $this->saveCache();

        $schema = $this->isForce() ? ('DROP TABLE IF EXISTS `' . $this->getCurrentTable()->getFullTableName() . '`;' . PHP_EOL . PHP_EOL) : '';
        $schema .= 'CREATE TABLE `' . $this->getCurrentTable()->getFullTableName() . '` (';
        $schema .= PHP_EOL . implode(',' . PHP_EOL, $fields) . (empty($keys) ? PHP_EOL : (',' . PHP_EOL . implode(',' . PHP_EOL, $keys) . PHP_EOL));
        $schema .= ') ENGINE ' . $this->getCurrentTable()->getEngine() . ' CHARSET ' . $this->getCurrentTable()->getCharset() . ' COMMENT "' . $this->getCurrentTable()->getComment() . '";';

        return $schema;
    }
protected function create()
    {
        $fields = [];
        $keys = [];

        foreach ($this->getCurrentTable()->getFields() as $name => $field) {
            $fields[] = implode(' ', [
                '`' . $field->getName() . '`',
                $field->getType() . '(' . $field->getLength() . ')',
                ($field->isUnsigned()) ? 'UNSIGNED' : '',
                ($field->isNullable() ? '' : ('NOT NULL')),
                (!$field->isIncrement() && !$field->isUnique() && !$field->isPrimary() ? 'DEFAULT "' . $field->getDefault() . '"' : '') ,
                ($field->isIncrement()) ? 'AUTO_INCREMENT' : '',
                'COMMENT "' . $field->getComment() . '"'
            ]);

            if (null !== $field->getKey()) {
                if ($field->isPrimary()) {
                    $keys[] = 'PRIMARY KEY (`' . $field->getName() . '`)';
                } else if ($field->isUnique()) {
                    $keys[] = 'UNIQUE KEY `unique_' . $field->getName() . '` (`' . $field->getName() . '`)';
                } else if ($field->isIndex()) {
                    $keys[] = 'KEY `index_' . $field->getName() . '` (`' . $field->getName() . '`)';
                }
            }

            $this->setCacheField($field);
        }

        $this->saveCache();

        $schema = $this->isForce() ? ('DROP TABLE IF EXISTS `' . $this->getCurrentTable()->getFullTableName() . '`;' . PHP_EOL . PHP_EOL) : '';
        $schema .= 'CREATE TABLE `' . $this->getCurrentTable()->getFullTableName() . '` (';
        $schema .= PHP_EOL . implode(',' . PHP_EOL, $fields) . (empty($keys) ? PHP_EOL : (',' . PHP_EOL . implode(',' . PHP_EOL, $keys) . PHP_EOL));
        $schema .= ') ENGINE ' . $this->getCurrentTable()->getEngine() . ' CHARSET ' . $this->getCurrentTable()->getCharset() . ' COMMENT "' . $this->getCurrentTable()->getComment() . '";';

        return $schema;
    }
protected function create ( ) { $ fields = [ ] ; $ keys = [ ] ; foreach ( $ this -> getCurrentTable ( ) -> getFields ( ) as $ name => $ field ) { $ fields [ ] = implode ( ' ' , [ '`' . $ field -> getName ( ) . '`' , $ field -> getType ( ) . '(' . $ field -> getLength ( ) . ')' , ( $ field -> isUnsigned ( ) ) ? 'UNSIGNED' : '' , ( $ field -> isNullable ( ) ? '' : ( 'NOT NULL' ) ) , ( ! $ field -> isIncrement ( ) && ! $ field -> isUnique ( ) && ! $ field -> isPrimary ( ) ? 'DEFAULT "' . $ field -> getDefault ( ) . '"' : '' ) , ( $ field -> isIncrement ( ) ) ? 'AUTO_INCREMENT' : '' , 'COMMENT "' . $ field -> getComment ( ) . '"' ] ) ; if ( null !== $ field -> getKey ( ) ) { if ( $ field -> isPrimary ( ) ) { $ keys [ ] = 'PRIMARY KEY (`' . $ field -> getName ( ) . '`)' ; } else if ( $ field -> isUnique ( ) ) { $ keys [ ] = 'UNIQUE KEY `unique_' . $ field -> getName ( ) . '` (`' . $ field -> getName ( ) . '`)' ; } else if ( $ field -> isIndex ( ) ) { $ keys [ ] = 'KEY `index_' . $ field -> getName ( ) . '` (`' . $ field -> getName ( ) . '`)' ; } } $ this -> setCacheField ( $ field ) ; } $ this -> saveCache ( ) ; $ schema = $ this -> isForce ( ) ? ( 'DROP TABLE IF EXISTS `' . $ this -> getCurrentTable ( ) -> getFullTableName ( ) . '`;' . PHP_EOL . PHP_EOL ) : '' ; $ schema .= 'CREATE TABLE `' . $ this -> getCurrentTable ( ) -> getFullTableName ( ) . '` (' ; $ schema .= PHP_EOL . implode ( ',' . PHP_EOL , $ fields ) . ( empty ( $ keys ) ? PHP_EOL : ( ',' . PHP_EOL . implode ( ',' . PHP_EOL , $ keys ) . PHP_EOL ) ) ; $ schema .= ') ENGINE ' . $ this -> getCurrentTable ( ) -> getEngine ( ) . ' CHARSET ' . $ this -> getCurrentTable ( ) -> getCharset ( ) . ' COMMENT "' . $ this -> getCurrentTable ( ) -> getComment ( ) . '";' ; return $ schema ; }
Return table create schema.

@return string
Return table create schema .