diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v002__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v002__create_db_connection_info.sql index f6ba295122b..408af2b5436 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v002__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v002__create_db_connection_info.sql @@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS mlmodel_service_entity ( UNIQUE (name) ); -UPDATE thread_entity SET json = JSON_SET(json, '$.type', 'Conversation'); +UPDATE thread_entity SET json = JSON_SET(json, '$.type', 'Conversation', '$.reactions', JSON_ARRAY()); ALTER TABLE thread_entity ADD type VARCHAR(64) GENERATED ALWAYS AS (json ->> '$.type'), diff --git a/bootstrap/sql/org.postgresql.Driver/v002__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v002__create_db_connection_info.sql index 942d88382d5..7bafaab6c1d 100644 --- a/bootstrap/sql/org.postgresql.Driver/v002__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v002__create_db_connection_info.sql @@ -30,6 +30,9 @@ CREATE TABLE IF NOT EXISTS mlmodel_service_entity ( UPDATE thread_entity SET json = jsonb_set(json, '{type}', '"Conversation"', true); +update thread_entity +SET json = jsonb_set(json, '{reactions}', '[]'::jsonb, true); + ALTER TABLE thread_entity ADD type VARCHAR(64) GENERATED ALWAYS AS (json ->> 'type') STORED NOT NULL, ADD taskId INT GENERATED ALWAYS AS ((json#>'{task,id}')::integer) STORED, diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/FeedRepository.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/FeedRepository.java index 56a16a14a17..333647477d5 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/FeedRepository.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/FeedRepository.java @@ -720,6 +720,7 @@ public class FeedRepository { restorePatchAttributes(original, updated); if (!updated.getReactions().isEmpty()) { + populateUserReactions(updated.getReactions()); updated .getReactions() .forEach(