-
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
Bug: insertBatch not generating createdField #3838
Comments
Did you set the |
Yes, I have set $useTimestamps to true, but it still null on database. |
Please provide your Model code where you are doing the insertBatch. |
Please confirm if you set the following correctly:
|
this is my code: `protected $table = 'data_miskin';
|
then, the code how are you inserting to the db? |
this is the code to insert to the db
|
Reading my emails, I've seen you've originally forgotten to include the created field in the allowed fields. Is your code still doing null inserts after inclusion? |
at the first code, I have forgot to include createdfield in the allowed field. Then I add the createdfield in the allowed fields, but it still same, the code not generated the timestamp/date in the createdfield with $db->insertBatch(); |
Created and updated fields do not need to be in allowedFields |
@wiedhodho which data type are you using for |
I use timestamp data type. |
We did not have any framework tests to confirm this so I added a few: |
It's working just fine, my guess is that you're using v4.0.4, and changes that add support for |
when I use insertBatch, the field createdField not generating current date/timestamp
database: mariadb
feature: insertbatch
The text was updated successfully, but these errors were encountered: