Skip to content

Commit 95c4cd9

Browse files
author
sachin-maheshwari
authored
Merge pull request #148 from topcoder-platform/feature/kafka-topic-name-change
SQL changes
2 parents 7debf0b + 20cd91a commit 95c4cd9

File tree

3 files changed

+76
-38
lines changed

3 files changed

+76
-38
lines changed

migrations/v2.0.1.sql

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,9 @@
22
ALTER TABLE "public"."NotificationSettings"
33
RENAME COLUMN "topic" TO "topicOld";
44

5-
-- add "topic" column
65
ALTER TABLE "public"."NotificationSettings"
7-
ADD COLUMN "topic" character varying(255);
6+
ALTER COLUMN "topicOld" DROP NOT NULL;
87

9-
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.completed' WHERE "topicOld"='connect.action.timeline.milestone.transition.completed'
10-
UPDATE "NotificationSettings" SET topic='connect.notification.project.product.update.spec' WHERE "topicOld"='connect.action.project.product.update.spec'
11-
UPDATE "NotificationSettings" SET topic='connect.notification.project.created' WHERE "topicOld"='notifications.connect.project.created'
12-
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.created' WHERE "topicOld"='notifications.connect.project.post.created'
13-
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.active' WHERE "topicOld"='notifications.connect.project.phase.transition.active'
14-
UPDATE "NotificationSettings" SET topic='connect.notification.project.approved' WHERE "topicOld"='notifications.connect.project.approved'
15-
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.edited' WHERE "topicOld"='notifications.connect.project.post.edited'
16-
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.updated' WHERE "topicOld"='connect.action.project.plan.updated'
17-
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.created' WHERE "topicOld"='notifications.connect.project.topic.created'
18-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.managerJoined' WHERE "topicOld"='notifications.connect.project.member.managerJoined'
19-
UPDATE "NotificationSettings" SET topic='connect.notification.project.specificationModified' WHERE "topicOld"='notifications.connect.project.specificationModified'
20-
UPDATE "NotificationSettings" SET topic='connect.notification.project.canceled' WHERE "topicOld"='notifications.connect.project.canceled'
21-
UPDATE "NotificationSettings" SET topic='connect.notification.project.active' WHERE "topicOld"='notifications.connect.project.active'
22-
UPDATE "NotificationSettings" SET topic='connect.notification.project.updated.spec' WHERE "topicOld"='connect.action.project.updated.spec'
23-
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.payment' WHERE "topicOld"='notifications.connect.project.phase.update.payment'
24-
UPDATE "NotificationSettings" SET topic='connect.notification.project.linkCreated' WHERE "topicOld"='notifications.connect.project.linkCreated'
25-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.rejected' WHERE "topicOld"='notifications.connect.project.member.invite.rejected'
26-
UPDATE "NotificationSettings" SET topic='connect.notification.project.completed' WHERE "topicOld"='notifications.connect.project.completed'
27-
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.scope' WHERE "topicOld"='notifications.connect.project.phase.update.scope'
28-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.requested' WHERE "topicOld"='notifications.connect.project.member.invite.requested'
29-
UPDATE "NotificationSettings" SET topic='connect.notification.project.paused' WHERE "topicOld"='notifications.connect.project.paused'
30-
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.ready' WHERE "topicOld"='connect.action.project.plan.ready'
31-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.copilotJoined' WHERE "topicOld"='notifications.connect.project.member.copilotJoined'
32-
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.deleted' WHERE "topicOld"='notifications.connect.project.topic.deleted'
33-
UPDATE "NotificationSettings" SET topic='connect.notification.project.submittedForReview' WHERE "topicOld"='notifications.connect.project.submittedForReview'
34-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.approved' WHERE "topicOld"='notifications.connect.project.member.invite.approved'
35-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.assignedAsOwner' WHERE "topicOld"='notifications.connect.project.member.assignedAsOwner'
36-
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.completed' WHERE "topicOld"='notifications.connect.project.phase.transition.completed'
37-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.removed' WHERE "topicOld"='notifications.connect.project.member.removed'
38-
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.active' WHERE "topicOld"='connect.action.timeline.milestone.transition.active'
39-
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.waiting.customer' WHERE "topicOld"='connect.action.timeline.milestone.waiting.customer'
40-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.joined' WHERE "topicOld"='notifications.connect.project.member.joined'
41-
UPDATE "NotificationSettings" SET topic='connect.notification.project.fileUploaded' WHERE "topicOld"='notifications.connect.project.fileUploaded'
42-
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.progress' WHERE "topicOld"='notifications.connect.project.phase.update.progress'
43-
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.deleted' WHERE "topicOld"='notifications.connect.project.post.deleted'
44-
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.left' WHERE "topicOld"='notifications.connect.project.member.left'
8+
-- add "topic" column
9+
ALTER TABLE "public"."NotificationSettings"
10+
ADD COLUMN "topic" character varying(255) NOT NULL;

migrations/v2.0.2.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.transition.completed' WHERE read='f' AND type='connect.action.timeline.milestone.transition.completed';
2+
UPDATE "Notifications" SET type='connect.notification.project.product.update.spec' WHERE read='f' AND type='connect.action.project.product.update.spec';
3+
UPDATE "Notifications" SET type='connect.notification.project.created' WHERE read='f' AND type='notifications.connect.project.created';
4+
UPDATE "Notifications" SET type='connect.notification.project.post.created' WHERE read='f' AND type='notifications.connect.project.post.created';
5+
UPDATE "Notifications" SET type='connect.notification.project.phase.transition.active' WHERE read='f' AND type='notifications.connect.project.phase.transition.active';
6+
UPDATE "Notifications" SET type='connect.notification.project.approved' WHERE read='f' AND type='notifications.connect.project.approved';
7+
UPDATE "Notifications" SET type='connect.notification.project.post.edited' WHERE read='f' AND type='notifications.connect.project.post.edited';
8+
UPDATE "Notifications" SET type='connect.notification.project.plan.updated' WHERE read='f' AND type='connect.action.project.plan.updated';
9+
UPDATE "Notifications" SET type='connect.notification.project.topic.created' WHERE read='f' AND type='notifications.connect.project.topic.created';
10+
UPDATE "Notifications" SET type='connect.notification.project.member.managerJoined' WHERE read='f' AND type='notifications.connect.project.member.managerJoined';
11+
UPDATE "Notifications" SET type='connect.notification.project.specificationModified' WHERE read='f' AND type='notifications.connect.project.specificationModified';
12+
UPDATE "Notifications" SET type='connect.notification.project.canceled' WHERE read='f' AND type='notifications.connect.project.canceled';
13+
UPDATE "Notifications" SET type='connect.notification.project.active' WHERE read='f' AND type='notifications.connect.project.active';
14+
UPDATE "Notifications" SET type='connect.notification.project.updated.spec' WHERE read='f' AND type='connect.action.project.updated.spec';
15+
UPDATE "Notifications" SET type='connect.notification.project.phase.update.payment' WHERE read='f' AND type='notifications.connect.project.phase.update.payment';
16+
UPDATE "Notifications" SET type='connect.notification.project.linkCreated' WHERE read='f' AND type='notifications.connect.project.linkCreated';
17+
UPDATE "Notifications" SET type='connect.notification.project.member.invite.rejected' WHERE read='f' AND type='notifications.connect.project.member.invite.rejected';
18+
UPDATE "Notifications" SET type='connect.notification.project.completed' WHERE read='f' AND type='notifications.connect.project.completed';
19+
UPDATE "Notifications" SET type='connect.notification.project.phase.update.scope' WHERE read='f' AND type='notifications.connect.project.phase.update.scope';
20+
UPDATE "Notifications" SET type='connect.notification.project.member.invite.requested' WHERE read='f' AND type='notifications.connect.project.member.invite.requested';
21+
UPDATE "Notifications" SET type='connect.notification.project.paused' WHERE read='f' AND type='notifications.connect.project.paused';
22+
UPDATE "Notifications" SET type='connect.notification.project.plan.ready' WHERE read='f' AND type='connect.action.project.plan.ready';
23+
UPDATE "Notifications" SET type='connect.notification.project.member.copilotJoined' WHERE read='f' AND type='notifications.connect.project.member.copilotJoined';
24+
UPDATE "Notifications" SET type='connect.notification.project.topic.deleted' WHERE read='f' AND type='notifications.connect.project.topic.deleted';
25+
UPDATE "Notifications" SET type='connect.notification.project.submittedForReview' WHERE read='f' AND type='notifications.connect.project.submittedForReview';
26+
UPDATE "Notifications" SET type='connect.notification.project.member.invite.approved' WHERE read='f' AND type='notifications.connect.project.member.invite.approved';
27+
UPDATE "Notifications" SET type='connect.notification.project.member.assignedAsOwner' WHERE read='f' AND type='notifications.connect.project.member.assignedAsOwner';
28+
UPDATE "Notifications" SET type='connect.notification.project.phase.transition.completed' WHERE read='f' AND type='notifications.connect.project.phase.transition.completed';
29+
UPDATE "Notifications" SET type='connect.notification.project.member.removed' WHERE read='f' AND type='notifications.connect.project.member.removed';
30+
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.transition.active' WHERE read='f' AND type='connect.action.timeline.milestone.transition.active';
31+
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.waiting.customer' WHERE read='f' AND type='connect.action.timeline.milestone.waiting.customer';
32+
UPDATE "Notifications" SET type='connect.notification.project.member.joined' WHERE read='f' AND type='notifications.connect.project.member.joined';
33+
UPDATE "Notifications" SET type='connect.notification.project.fileUploaded' WHERE read='f' AND type='notifications.connect.project.fileUploaded';
34+
UPDATE "Notifications" SET type='connect.notification.project.phase.update.progress' WHERE read='f' AND type='notifications.connect.project.phase.update.progress';
35+
UPDATE "Notifications" SET type='connect.notification.project.post.deleted' WHERE read='f' AND type='notifications.connect.project.post.deleted';
36+
UPDATE "Notifications" SET type='connect.notification.project.member.left' WHERE read='f' AND type='notifications.connect.project.member.left';

migrations/v2.0.3.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.completed' WHERE "topicOld"='connect.action.timeline.milestone.transition.completed';
2+
UPDATE "NotificationSettings" SET topic='connect.notification.project.product.update.spec' WHERE "topicOld"='connect.action.project.product.update.spec';
3+
UPDATE "NotificationSettings" SET topic='connect.notification.project.created' WHERE "topicOld"='notifications.connect.project.created';
4+
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.created' WHERE "topicOld"='notifications.connect.project.post.created';
5+
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.active' WHERE "topicOld"='notifications.connect.project.phase.transition.active';
6+
UPDATE "NotificationSettings" SET topic='connect.notification.project.approved' WHERE "topicOld"='notifications.connect.project.approved';
7+
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.edited' WHERE "topicOld"='notifications.connect.project.post.edited';
8+
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.updated' WHERE "topicOld"='connect.action.project.plan.updated';
9+
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.created' WHERE "topicOld"='notifications.connect.project.topic.created';
10+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.managerJoined' WHERE "topicOld"='notifications.connect.project.member.managerJoined';
11+
UPDATE "NotificationSettings" SET topic='connect.notification.project.specificationModified' WHERE "topicOld"='notifications.connect.project.specificationModified';
12+
UPDATE "NotificationSettings" SET topic='connect.notification.project.canceled' WHERE "topicOld"='notifications.connect.project.canceled';
13+
UPDATE "NotificationSettings" SET topic='connect.notification.project.active' WHERE "topicOld"='notifications.connect.project.active';
14+
UPDATE "NotificationSettings" SET topic='connect.notification.project.updated.spec' WHERE "topicOld"='connect.action.project.updated.spec';
15+
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.payment' WHERE "topicOld"='notifications.connect.project.phase.update.payment';
16+
UPDATE "NotificationSettings" SET topic='connect.notification.project.linkCreated' WHERE "topicOld"='notifications.connect.project.linkCreated';
17+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.rejected' WHERE "topicOld"='notifications.connect.project.member.invite.rejected';
18+
UPDATE "NotificationSettings" SET topic='connect.notification.project.completed' WHERE "topicOld"='notifications.connect.project.completed';
19+
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.scope' WHERE "topicOld"='notifications.connect.project.phase.update.scope';
20+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.requested' WHERE "topicOld"='notifications.connect.project.member.invite.requested';
21+
UPDATE "NotificationSettings" SET topic='connect.notification.project.paused' WHERE "topicOld"='notifications.connect.project.paused';
22+
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.ready' WHERE "topicOld"='connect.action.project.plan.ready';
23+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.copilotJoined' WHERE "topicOld"='notifications.connect.project.member.copilotJoined';
24+
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.deleted' WHERE "topicOld"='notifications.connect.project.topic.deleted';
25+
UPDATE "NotificationSettings" SET topic='connect.notification.project.submittedForReview' WHERE "topicOld"='notifications.connect.project.submittedForReview';
26+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.approved' WHERE "topicOld"='notifications.connect.project.member.invite.approved';
27+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.assignedAsOwner' WHERE "topicOld"='notifications.connect.project.member.assignedAsOwner';
28+
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.completed' WHERE "topicOld"='notifications.connect.project.phase.transition.completed';
29+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.removed' WHERE "topicOld"='notifications.connect.project.member.removed';
30+
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.active' WHERE "topicOld"='connect.action.timeline.milestone.transition.active';
31+
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.waiting.customer' WHERE "topicOld"='connect.action.timeline.milestone.waiting.customer';
32+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.joined' WHERE "topicOld"='notifications.connect.project.member.joined';
33+
UPDATE "NotificationSettings" SET topic='connect.notification.project.fileUploaded' WHERE "topicOld"='notifications.connect.project.fileUploaded';
34+
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.progress' WHERE "topicOld"='notifications.connect.project.phase.update.progress';
35+
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.deleted' WHERE "topicOld"='notifications.connect.project.post.deleted';
36+
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.left' WHERE "topicOld"='notifications.connect.project.member.left';

0 commit comments

Comments
 (0)