Untitled

 avatar
unknown
plain_text
a year ago
590 B
9
Indexable
CREATE OR REPLACE FUNCTION public.simple_trigger_test() RETURNS TRIGGER AS $$
BEGIN
    RAISE LOG 'Test log message';
    SET search_path = public, stripe, auth, pg_catalog;
    INSERT INTO public.debug_log(message) VALUES ('Simple trigger test executed.');
    RETURN NEW;
END
$$ LANGUAGE plpgsql SECURITY DEFINER;

-- Make sure to drop the existing trigger before creating a new one
DROP TRIGGER IF EXISTS simple_test_trigger ON stripe.invoices;

CREATE TRIGGER simple_test_trigger
AFTER INSERT ON stripe.invoices
FOR EACH ROW
EXECUTE FUNCTION public.simple_trigger_test();
Editor is loading...
Leave a Comment