Skip to content

Default trigger names are bit strange #165

Description

@quevon24

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions