Hi, i don't know if this is a bug or if the intention is for it to be like this, but if you don't set a custom label for InsertEvent, UpdateEvent or DeleteEvent, you will get some weird trigger names because the label and the operation have the same name, something like:
- pgtrigger_update_update_xxxxx
- pgtrigger_delete_delete_xxxxx
- pgtrigger_insert_insert_xxxxx
Maybe instead of generating the trigger name this way:
self.trigger_name = trigger_name or self.trigger_name or f"{self.label}_{self.operation}"
We can do something like:
self.trigger_name = trigger_name or self.trigger_name or f"{self.label}_{self.operation}" if self.label != self.operation else str(self.operation)
That way, if you don't pass a custom label you end up with something like:
- pgtrigger_update_xxxxx
- pgtrigger_delete_xxxxx
- pgtrigger_insert_xxxxx
Hi, i don't know if this is a bug or if the intention is for it to be like this, but if you don't set a custom label for InsertEvent, UpdateEvent or DeleteEvent, you will get some weird trigger names because the label and the operation have the same name, something like:
Maybe instead of generating the trigger name this way:
We can do something like:
That way, if you don't pass a custom label you end up with something like: