Best,
You forget to fill in what datatype 'create_at' is.
Example from the documentation.
PHP Code:
$fields = [
'created_at' => ['type' => 'DATETIME']
];
$forge->addColumn('users', $fields);
// Executes: ALTER TABLE users ADD preferences DATETIME
But can also use the model for filling the 'created at' field.
PHP Code:
<?php namespace App\Models;
use CodeIgniter\Model;
class UserModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useSoftDeletes = true;
protected $allowedFields = ['name', 'email'];
protected $useTimestamps = true;
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
}
Be sure you have added these field to your database.
André