This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello.There is a backend page with a form with two fields. When I create new record an error occurs and tells the following:
Column not found: 1054 Unknown column 'fake_uid' in 'field list' (SQL: insert into 'fakes_list' ('fake_uid', 'auth_key', 'updated_at', 'created_at') values (45345, 345345, 2019-02-03 09:57:11, 2019-02-03 09:57:11))...
The table fakes_list
doesn't have updated_at
and created_at
columns. How can I remove them from the query? And how to change fake_uid
to other name? Because there is no such column, indeed (as the error says).
I tried to add $purgable variable to my model:
use \October\Rain\Database\Traits\Purgeable; protected $purgeable = ['created_at', 'updated_at'];
Not working. But if I add, for example, fake_uid
- it will be removed from the query. Hm??
protected $fillable = ['fake_uid', 'auth_key'];
(without created, updated). Not working.
In fields.yaml
set hidden: true
to field created_at (although there is no such field on my backend page). Not working. The insert query still consists these columns.
Last updated
Solved! By default, a model will expect created_at and updated_at columns to exist on your tables. If you do not wish to have these columns managed automatically, set the $timestamps property on your model to false:
class Post extends Model { /**
- Indicates if the model should be timestamped.
- @var bool */ public $timestamps = false; }
Last updated
1-2 of 2