How to create triggers in Data Grip?

Shankha057 picture Shankha057 · Apr 28, 2017 · Viewed 7.4k times · Source

I want to create triggers in my table.I am using Data Grip as an interface to connect to my database.I googled around and the documentation said that it had something like a "Generate" drop down list which has something like function and procedures templates available for creation.But I get no such drop down list and even when I go to the new option after right clicking a table,I don't get an option for functions or procedures. I am using DataGrip 2017.1.2 and a MySQL data source.

Answer

kassak picture kassak · May 24, 2017

As an alternative to @Andrew 's answer (since 2016.3 or .2), you can:

  • Open database console
  • Press Alt+Ins (Cmd+N on Mac)
  • "Generate" menu will pop up
  • Select "Trigger"
  • A "live template" will start
  • Type trigger name...Enter
  • Type table name...Enter
  • ...
  • Execute resulting script with Ctrl+Enter