in my yii2 advanced template, i get the exception SQLSTATE[22003] of the database.
with this error message:
SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'created_at' at row 1 The SQL being executed was: INSERT INTO
user
(username
,password_hash
,auth_key
,status
,created_at
,updated_at
) VALUES ('test', '[email protected]', 'someval', 'someval', 10, NOW(), NOW())
i checked the fields that cause this exception (i've assumed that are the date fields created_at and updated_at) and they're both int(20).
in the model i've timestamp behavior:
/**
* @inheritdoc
*/
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
],
'value' => new \yii\db\Expression('NOW()')
],
];
}
I really don't know what cause this error. This is the standard registration functionality inserted in the yii2 advanced template.
Thanks in advance for the help