django-pgtrigger icon indicating copy to clipboard operation
django-pgtrigger copied to clipboard

can't create Constraint Trigger

Open likecodingloveproblems opened this issue 3 years ago • 1 comments

I can't create CONSTRAINT TRIGGER and also set DEFERRABLE INITIALLY DEFERRED settings.

likecodingloveproblems avatar Aug 13 '22 07:08 likecodingloveproblems

Did you read this section of the docs on how to do this? Or did you try it and receive an error?

Deferrable constraint triggers are configured by setting the timing argument of the trigger. For example:

class MyModel(Model):
    class Meta:
        triggers = [
            pgtrigger.Trigger(name="constraint_trigger", timing=pgtrigger.Deferred, ...)
        ]

wesleykendall avatar Aug 14 '22 02:08 wesleykendall

Going to close this since I believe it's been answered. Feel free to re-open you're still having issues

wesleykendall avatar Aug 17 '22 19:08 wesleykendall