All pastes #384044 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-03-06 20:03 UTC
rendered paste body
BEGIN
  NEW.status_update = OLD.status_update;
  IF OLD.status_update IS NULL THEN
    NEW.status_update = NULL;
    IF (OLD.status <> 1) AND (NEW.STATUS = 1) THEN
      NEW.status_update = NOW();
    END IF;
  END IF;
  RETURN NEW;
END;