Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Add migration code for old mentions

Matt Roberts7965434f8de5
diff --git a/migrations/202503202000_mentions_notifications.sql b/migrations/202503202000_mentions_notifications.sql
index eb919b05b..00d5aae33 100644
--- a/migrations/202503202000_mentions_notifications.sql
+++ b/migrations/202503202000_mentions_notifications.sql
@@ -12,4 +12,15 @@ create table
constraint unique_mention_notification unique (tenant_id, user_id, comment_id)
);
-create index idx_mention_notifications_tenant_user on mention_notifications (tenant_id, user_id);
\ No newline at end of file
+create index idx_mention_notifications_tenant_user on mention_notifications (tenant_id, user_id);
+
+UPDATE comments
+SET
+ content = regexp_replace (
+ content,
+ '@{"id":([0-9]+),"name":"([^"]+)","isNew":(true|false)}',
+ '@[\2]',
+ 'g'
+ )
+WHERE
+ content LIKE '%@{"id":%'
\ No newline at end of file