When attempting to seed data into my database table I keep on receiving the following error:
[PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'valueone' in 'field list'
I have searched all over stackoverflow and google but I'm unable to find a solution. I have tried migrating, refactoring my class names and seeding repeatedly.
My migration file:
public function change() {
$table = $this->table('custom_values');
$table->addColumn('valueone', 'string', [
'default' => null,
'limit' => 27,
'null' => false,
]);
$table->addColumn('valuetwo', 'date', [
'default' => null,
'null' => false,
]);
$table->addColumn('valuethree', 'boolean', [
'default' => null,
'null' => false,
]);
$table->create();
}
My seeder:
public function run() {
$data = [
[
'valueone' => 'NL',
'valuetwo' => date('Y-m-d H:i:s'),
'valuethree' => true,
],
];
$table = $this->table('custom_values');
$table->insert($data)
->save();
}
If only you could help me resolve this issue that would be very much appreciated. Happy coding!