2

I have a MySQL database and an automation script which modifies the data inside once a day. And these columns may have changed by an user manually. What is the best approach to make the system only update the automated data, not the manually edited ones? I mean yes, flagging the cell which is manually edited is one way to do it, but I want to know if there's another way to accomplish this? Just curiosity.

BTW, the question is about cell values, not rows.

2 Answers 2

1

I would put two DateTime columns in those tables, one called lastUserEdit and the other one called lastAutomatedEdit. That way, you always know whether the last edit on each row was done by a user or automatically by simply comparing these two dates.

1
  • but it's not any different from flagging. just using date1>date2 as the boolean value.
    – tpaksu
    Mar 26, 2012 at 14:10
0

Flagging as you have mentioned is what I'd do. Just by updating the value in an ENUM column ('0','1') to let you know who last updated the record.

1
  • Yes but I'm looking for different approaches. Like when it's a string, I would prepend a "user:" to it, when it's a date I would add 20 years to it if its user edited etc. And BTW the question is about cells. not rows.
    – tpaksu
    Mar 26, 2012 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.