UpdatedAt column - Postgres

What's the best practice way to achieve a standard "updatedAt" column with the pg wrapper? I've seen mysql has timestamp('updated_at').defaultNow().onUpdateNow().notNull() However onUpdateNow() doesn't appear to be there for pg.
2 Replies
peachneo
peachneoOP16mo ago
Ok I see, postgres requires a trigger. Can I add a trigger and have it accounted for by drizzle-kit as part of a migration?
Angelelz
Angelelz16mo ago
You'd need to add it to your migration file manually
Want results from more Discord servers?
Add your server