Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ColumnSchemaBuilder can not work with custom types
In our project we use trait with custom types, example: ```php trait MigrationToolTrait { protected function dateTimeWithTZ ($precision = null) { if ('pgsql' === $this->db->driverName) { return $this->getDb()->getSchema()->createColumnSchemaBuilder(sprintf('timestamp(%d) with time zone', $precision)); } return $this->dateTime($precision); } } ``` usage: ```php class m160516_161900_init { use MigrationToolTrait; public function safeUp () { $this->createTable('testing', [ 'id' => $this->primaryKey(), 'startDate' => $this->dateTimeWithTZ()->notNull()->defaultExpression('now()'), ]); } public function safeDown () { $this->dropTable('testing'); } } ``` In version 2.0.8 MigrateController generate notice: PHP Notice 'yii\base\ErrorException' with message 'Undefined index: timestamp(0) with time zone' in vendor/yiisoft/yii2/db/ColumnSchemaBuilder.php:366 We offer our change to fix it.
- Loading branch information