Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriberTest::createTableSchema PHP Method

createTableSchema() protected method

protected createTableSchema ( )
    protected function createTableSchema()
    {
        $table = new \Doctrine\DBAL\Schema\Table('points');
        $table->addColumn('id', 'integer', array('notnull' => true));
        $table->addColumn('text', 'text', array('notnull' => true));
        $table->addColumn('tsvector', 'tsvector', array('notnull' => true));
        $table->addColumn('geometry', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'GEOMETRY', 'srid' => 0));
        $table->addColumn('point', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 0));
        $table->addColumn('point_2d', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 3785));
        $table->addColumn('point_3dz', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINTZ', 'srid' => 3785));
        $table->addColumn('point_3dm', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINTM', 'srid' => 3785));
        $table->addColumn('point_4d', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINTZM', 'srid' => 3785));
        $table->addColumn('point_2d_nullable', 'geometry', array('notnull' => false))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 3785));
        $table->addColumn('point_2d_nosrid', 'geometry', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 0));
        $table->addColumn('geography', 'geography', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'GEOMETRY', 'srid' => 4326));
        $table->addColumn('point_geography_2d', 'geography', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 4326));
        $table->addColumn('point_geography_2d_srid', 'geography', array('notnull' => true))->setCustomSchemaOptions(array('geometry_type' => 'POINT', 'srid' => 4326));
        $table->addIndex(array('text'), 'idx_text');
        $table->addIndex(array('tsvector'), 'idx_text_gist');
        $table->addIndex(array('point'), null, array('spatial'));
        $table->addIndex(array('point_2d'), null, array('spatial'));
        $table->addIndex(array('point_3dz'), null, array('spatial'));
        $table->addIndex(array('point_3dm'), null, array('spatial'));
        $table->addIndex(array('point_4d'), null, array('spatial'));
        $table->addIndex(array('point_2d_nullable'), null, array('spatial'));
        $table->addIndex(array('point_2d_nosrid'), null, array('spatial'));
        $table->addIndex(array('point_geography_2d'), null, array('spatial'));
        $table->addIndex(array('point_geography_2d_srid'), null, array('spatial'));
        $table->setPrimaryKey(array('id'));
        return $table;
    }