DEV Community

Discussion on: Knex ❤️ PSQL: updating timestamps like a pro

Collapse
 
cryptodoct0r profile image
EMMANUEL NENI

For anyone confused about the triger function,

If you have multiple migration files in a set order, you might need to artificially change the date stamp in the filename to get this to run first (or just add it to your first migration file).

I suggest moving the already made migrations, create a npx knex migrate:make tigger_updated_at them past the trigger funciton here and remake your sequence of migrations so the trigger function works first.

But if you can't roll back, you might need to do this step manually via psql.

Thankyou for the post. It was quit informative