protected function getSchema($connectionName = null)
    {
        $connectionName = $connectionName === null ? $this->connectionName : $connectionName;

        /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */
        $schema = app('db')->connection($connectionName)->getDoctrineSchemaManager();
        // For MySQL
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
        // For Sqlite
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('long', 'integer');
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('bit', 'boolean');

        return $schema;
    }
protected function getSchema($connectionName = null)
    {
        $connectionName = $connectionName === null ? $this->connectionName : $connectionName;

        /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */
        $schema = app('db')->connection($connectionName)->getDoctrineSchemaManager();
        // For MySQL
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
        // For Sqlite
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('long', 'integer');
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('bit', 'boolean');

        return $schema;
    }
protected function getSchema ( $ connectionName = null ) { $ connectionName = $ connectionName === null ? $ this -> connectionName : $ connectionName ; /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */ $ schema = app ( 'db' ) -> connection ( $ connectionName ) -> getDoctrineSchemaManager ( ) ; // For MySQL $ schema -> getDatabasePlatform ( ) -> registerDoctrineTypeMapping ( 'enum' , 'string' ) ; // For Sqlite $ schema -> getDatabasePlatform ( ) -> registerDoctrineTypeMapping ( 'long' , 'integer' ) ; $ schema -> getDatabasePlatform ( ) -> registerDoctrineTypeMapping ( 'bit' , 'boolean' ) ; return $ schema ; }
Get pdo instance for database connection

@param string|null $connectionName database connection name (if null default connection is used)

@return \Doctrine\DBAL\Schema\AbstractSchemaManager
Get pdo instance for database connection