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:Jump to 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...
4 Replies
Im also using T3 stack. (NextJS 14 App Router)
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
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 migrationsThank you very much!