DT
Drizzle Team•2mo ago
Salumsu

Where to define Postgres Triggers?

Hi guys, I am relatively new in using drizzle orm, and this is my first time trying to use postgres triggers with it. Where is the best place to define triggers? I can't find any related information in the documentation. Thank you in advance.
Solution:
👋 there is no builtin feature for that. Though, you can do a custom migration (https://discord.com/channels/1043890932593987624/1043890932593987627/1268521683023695992) and put your triggers here...
Jump to solution
4 Replies
Salumsu
Salumsu•2mo ago
Im also using T3 stack. (NextJS 14 App Router)
Solution
rphlmr âš¡
rphlmr ⚡•2mo ago
👋 there is no builtin feature for that. Though, you can do a custom migration (https://discord.com/channels/1043890932593987624/1043890932593987627/1268521683023695992) and put your triggers here
rphlmr âš¡
rphlmr ⚡•2mo ago
drizzle-kit generate —custom Then an empty sql file is created in your migrations folder. You can write your custom sql and migrate when done. It will be handled like other migrations
Salumsu
Salumsu•2mo ago
Thank you very much!
Want results from more Discord servers?
Add your server