src/Migrations/SyntaxBuilder.php
private function createSchemaForUpMethod($schema, $meta)
    {
        //dd($schema);
        $fields = $this->constructSchema($schema);


        if ($meta['action'] == 'create') {
            return $this->insert($fields)->into($this->getCreateSchemaWrapper());
        }

        if ($meta['action'] == 'add') {
            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }

        if ($meta['action'] == 'remove') {
            $fields = $this->constructSchema($schema, 'Drop');

            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }

        // Otherwise, we have no idea how to proceed.
        throw new GeneratorException;
    }
private function createSchemaForUpMethod($schema, $meta)
    {
        //dd($schema);
        $fields = $this->constructSchema($schema);


        if ($meta['action'] == 'create') {
            return $this->insert($fields)->into($this->getCreateSchemaWrapper());
        }

        if ($meta['action'] == 'add') {
            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }

        if ($meta['action'] == 'remove') {
            $fields = $this->constructSchema($schema, 'Drop');

            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }

        // Otherwise, we have no idea how to proceed.
        throw new GeneratorException;
    }
private function createSchemaForUpMethod ( $ schema , $ meta ) { //dd($schema); $ fields = $ this -> constructSchema ( $ schema ) ; if ( $ meta [ 'action' ] == 'create' ) { return $ this -> insert ( $ fields ) -> into ( $ this -> getCreateSchemaWrapper ( ) ) ; } if ( $ meta [ 'action' ] == 'add' ) { return $ this -> insert ( $ fields ) -> into ( $ this -> getChangeSchemaWrapper ( ) ) ; } if ( $ meta [ 'action' ] == 'remove' ) { $ fields = $ this -> constructSchema ( $ schema , 'Drop' ) ; return $ this -> insert ( $ fields ) -> into ( $ this -> getChangeSchemaWrapper ( ) ) ; } // Otherwise, we have no idea how to proceed. throw new GeneratorException ; }
Create the schema for the "up" method.

@param  string $schema
@param  array $meta
@return string
@throws GeneratorException
Create the schema for the up method .