Yii2: How to create special field (jsonb, geometry and others) in postgres on migration?

Created on 24 Sep 2016  路  2Comments  路  Source: yiisoft/yii2

we use Posgresql with expansion(PostGis) in our project. How we can make migration to the fields type : JsonB and Geometry ?

question

Most helpful comment

        $this->createTable('company', [
            'id' => $this->primaryKey(),
            'name' => $this->string(50)->notNull(),
            'address' => $this->text()->notNull(),
            'zone' =>  'geometry(Polygon, 4326)',
            'created_at' => $this->integer(),
            'updated_at' => $this->integer(),
        ], $tableOptions);

All 2 comments

        $this->createTable('company', [
            'id' => $this->primaryKey(),
            'name' => $this->string(50)->notNull(),
            'address' => $this->text()->notNull(),
            'zone' =>  'geometry(Polygon, 4326)',
            'created_at' => $this->integer(),
            'updated_at' => $this->integer(),
        ], $tableOptions);

_This is an automated comment, triggered by adding the label question._

Please note, that the GitHub Issue Tracker is for bug reports and feature requests only.

We are happy to help you on the support forum, on IRC (#yii on freenode), or Gitter.

Please use one of the above mentioned resources to discuss the problem.
If the result of the discussion turns out that there really is a bug in the framework, feel free to
come back and provide information on how to reproduce the issue. This issue will be closed for now.

Was this page helpful?
0 / 5 - 0 ratings