1
votes

We have a table with columns: created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

When we are updating it from active record the insert query contains created_at and updated_at columns.

Even after setting config.active_record.record_timestamps = false Active record is sending created_at and updated_at as null.

Is there any way to not send these columns at all as we want to handle it at mysql level.

1

1 Answers

0
votes

as far as mysql concerned, your updated_on columns should be as per below for auto update-

updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP