bigint() error in auto-generated migration


I am new to yii, trying to perform a migration which is generated using :

yii migrate/create create_wallet_table --fields="user_id:integer:notNull:foreignKey(user),credit:bigint:def


I get an error :Calling unknown method: m170725_072726_create_wallet_table::bigint();

the migration code which is generated by yii using the command contains the following line which causes the error:

‘credit’ => $this->bigint()->defaultValue(0),

I changed bigint() to bigInt() or bigint(16) I still get the same error,

could you please let me know what is the problem?

Thanks in advance

Are you on 2.0.8 or newer?

My Yii version is 2.0.12

Should be

'credit' => $this->bigInteger()->defaultValue(0),

1 Like

Thank you very much, that solved the problem!