Am I misunderstanding something here? I have two tables, table1 and table2. Table2 has a foreign key that references a field in table1 with ON DELETE SET NULL
associated with the foreign key. Table2 also has a TIMESTAMP
field that has ON UPDATE CURRENT_TIMESTAMP
set.
Modifying an entry in table2 successfully updates the timestamp field.
Deleting the linked entry in table1 successfully sets the foreign key field in table2 to NULL
, but does not update the TIMESTAMP
field in table2.
When the field in in table2 gets set to NULL, isn't that considered an UPDATE
, and the timestamp should get updated too?