-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated_at field is filled with the current timestamp when inserting new data along with created_at #4038
Comments
Based on the Model's code, during data inserts the |
Shouldn't be |
I'm not the proper person to answer the logic behind the setting of If you want to circumvent this behavior without adding additional code, you can do is add the You can do something like this: $data = [
'name' => 'foo',
'description' => 'bar',
'updated_at' => null, // don't forget to add this line to force not setting `updated_at` with same date as `created_at`
];
// insert the data using our model
$model->insert($data); |
You didn't mis-configure. That's by design. That allows you to include newly created records when sorting by the most recently updated. |
Well I can't log in on there. Here's the screenshot:
So, here it is. I'm just saying it straight away. The
updated_at
field is filled with the current timestamp when inserting new data, while it shouldn't. I don't know what I'm misconfigured of but, been tried everything, seems same. Here's the capture:And here's the model:
And here's the data type:
I hope someone could help me. I need a date of when the data is updated, but seems for now I need to do it manually. Thank you.
The text was updated successfully, but these errors were encountered: