Field with type enum in migrations

Good day, all.
How me add field with type enum in migrations
To example $this->addColumn({{‘ads’}},‘status_pay’, $this->enum(‘in_pay’,‘payed’)->default(‘in_pay’))

Hi.
I think, there is no ‘enum’ ready trait among those prepared (@community?): https://www.yiiframework.com/doc/api/2.0/yii-db-schemabuildertrait

However you can try to declare the enum column in migration with raw SQL similiar to:
$this->addColumn('table', 'column',"ENUM('apple','orange','pear')");

See https://www.yiiframework.com/doc/api/2.0/yii-db-migration#addColumn()-detail

[…] Anything that is not recognized as abstract type will be kept in the generated SQL.

Good advice :+1: