10 lines
648 B
PL/PgSQL
10 lines
648 B
PL/PgSQL
SET search_path TO atlas, public;
|
|
|
|
CREATE FUNCTION invalidate_profile_pricing() RETURNS trigger LANGUAGE plpgsql SET search_path = atlas, public AS $$
|
|
BEGIN
|
|
UPDATE product_variant_platform_listings SET pricing_valid=false WHERE profile_id=NEW.id;
|
|
RETURN NEW;
|
|
END $$;
|
|
CREATE TRIGGER profile_pricing_changed AFTER UPDATE OF target_store_id,platform_product_category_id,fulfillment ON product_platform_profiles
|
|
FOR EACH ROW WHEN (ROW(OLD.target_store_id,OLD.platform_product_category_id,OLD.fulfillment) IS DISTINCT FROM ROW(NEW.target_store_id,NEW.platform_product_category_id,NEW.fulfillment)) EXECUTE FUNCTION invalidate_profile_pricing();
|