How do you create a history table in prisma? The e...
# orm-help
d
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
Hey Dan! Have you looked at Prisma middleware’s? https://www.prisma.io/docs/concepts/components/prisma-client/middleware
r
@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.