From 5e68410e7abe074cf4ce78fcf154d6b036d9d443 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Fri, 10 Jan 2025 16:15:26 +0300 Subject: [PATCH] Include comment ids in replicate-changesets --- .../planet/files/default/replication-bin/replicate-changesets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index cee87bd26..bb4544f68 100755 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -96,7 +96,7 @@ class ChangesetBuilder def add_comments(xml, cs) # grab the visible changeset comments as well - res = @conn.exec("select cc.author_id, u.display_name as author, cc.body, (cc.created_at at time zone 'utc') as created_at from changeset_comments cc join users u on cc.author_id=u.id where cc.changeset_id=#{cs.id} and cc.visible order by cc.created_at asc") + res = @conn.exec("select cc.id, cc.author_id, u.display_name as author, cc.body, (cc.created_at at time zone 'utc') as created_at from changeset_comments cc join users u on cc.author_id=u.id where cc.changeset_id=#{cs.id} and cc.visible order by cc.created_at asc") xml["comments_count"] = res.num_tuples.to_s # early return if there aren't any comments @@ -105,6 +105,7 @@ class ChangesetBuilder discussion = XML::Node.new("discussion") res.each do |row| comment = XML::Node.new("comment") + comment["id"] = row["id"] comment["uid"] = row["author_id"] comment["user"] = xml_sanitize(row["author"]) comment["date"] = Time.parse(row["created_at"]).getutc.xmlschema