diff --git a/packages/db/postgres/functions.sql b/packages/db/postgres/functions.sql index ebb2bb0d41..41b2743431 100644 --- a/packages/db/postgres/functions.sql +++ b/packages/db/postgres/functions.sql @@ -93,8 +93,8 @@ BEGIN data ->> 'source_cid', (data ->> 'type')::upload_type, data ->> 'name', - (data ->> 'updated_at')::timestamptz, - (data ->> 'inserted_at')::timestamptz) + (data ->> 'inserted_at')::timestamptz, + (data ->> 'updated_at')::timestamptz) ON CONFLICT ( user_id, source_cid ) DO UPDATE SET "updated_at" = (data ->> 'updated_at')::timestamptz, "deleted_at" = null