Public feed
#721562
-- NAME: orders_check_for_payment_status ()
-- RETURNS: "trigger"
-- Language: plpgsql
-- Triggered on: UPDATE, INSERT on orders table
--
-- monitors payment_status, if it's 1 then sets the internal_id to the next increment value.
--
BEGIN
--check to see if payment status was changed to 1
IF(NEW.payment_status = 1) THEN
NEW.internal_id := nextval('orders_internal_id_seq')
END IF;
return NEW;
END;