Skip to content

Bug: set_updated_at() trigger still writes to updated_at instead of _updated_at #91

@doxsch

Description

@doxsch

In migration 0048, all reserved timestamp columns were renamed to include a leading underscore (e.g., updated_at → _updated_at).
However, the trigger function responsible for maintaining these timestamps was not updated accordingly.

New migration to solve the issue:

create or replace function set_updated_at() returns trigger
    language plpgsql
as
$$
begin
  new._updated_at = now(); /* columns are named _updated_at */
  return NEW;
end;
$$;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions