Welcome Guest, Not a member yet? Register   Sign In
Update aka 'touch' database
#3

(This post was last modified: 08-17-2020, 10:53 AM by bogus.)

(08-17-2020, 03:21 AM)InsiteFX Wrote: $useTimestamps

This boolean value determines whether the current date is automatically added to all inserts and updates.
If true, will set the current time in the format specified by $dateFormat. This requires that the table
have columns named ‘created_at’ and ‘updated_at’ in the appropriate data type.

Ok, thanks, understood.

Your reply implies now that I need to use the base-class method 'update' to update a row or a field/fields in the table, correct?

The whole point I'm posting this is, that I only need to update the column updated_at and no other.
I understood the docs and your resembling reply that both fields are updated with a timestamp of my chosen format, correct?

This means unwanted behavior.

Leaving created_at empty in my model isn't going to be a solution nor to work because it will throw an exception.

Further, how can I update a row without changing it's content?

As I have understood the docs, you need to change a field to be able to update and update the updated_at and created_at fields with a timestamp of format x.


Do you have some code suggestions?
Reply


Messages In This Thread
Update aka 'touch' database - by bogus - 08-16-2020, 10:08 PM
RE: Update aka 'touch' database - by InsiteFX - 08-17-2020, 03:21 AM
RE: Update aka 'touch' database - by bogus - 08-17-2020, 10:48 AM
RE: Update aka 'touch' database - by Gary - 08-18-2020, 04:24 AM
RE: Update aka 'touch' database - by InsiteFX - 08-18-2020, 11:45 AM
RE: Update aka 'touch' database - by Gary - 08-18-2020, 01:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB