mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 04:26:57 +00:00
Fix migration script for migrations to 0.11 (#5773)
This commit is contained in:
parent
f7a10fe5a6
commit
e826c98acf
@ -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'),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -720,6 +720,7 @@ public class FeedRepository {
|
||||
restorePatchAttributes(original, updated);
|
||||
|
||||
if (!updated.getReactions().isEmpty()) {
|
||||
populateUserReactions(updated.getReactions());
|
||||
updated
|
||||
.getReactions()
|
||||
.forEach(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user