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
peachneoOP17mo 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
Angelelz17mo ago
You'd need to add it to your migration file manually

Did you find this page helpful?