Join Slack
Powered by
How do you create a history table in prisma? The e...
# orm-help
d
Dan Shapir
07/17/2021, 8:20 PM
How do you create a history table in prisma? The equivalent is using triggers, each time there is an update, you save the current copy in the history table. But how can this be done in Prisma as there are no triggers?
đź‘€ 1
a
Albin Groen
07/17/2021, 10:00 PM
Hey Dan! Have you looked at Prisma middleware’s?
https://www.prisma.io/docs/concepts/components/prisma-client/middleware
r
Ryan
07/19/2021, 7:09 AM
@Dan Shapir
đź‘‹ Could you try creating triggers in your migration
.sql
files? This should work after you run the migrations and the trigger will run automatically.
5
Views
Open in Slack
Previous
Next