Skip to content

SQL changes related to kafka topic name change #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 4 additions & 38 deletions migrations/v2.0.1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,9 @@
ALTER TABLE "public"."NotificationSettings"
RENAME COLUMN "topic" TO "topicOld";

-- add "topic" column
ALTER TABLE "public"."NotificationSettings"
ADD COLUMN "topic" character varying(255);
ALTER COLUMN "topicOld" DROP NOT NULL;

UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.completed' WHERE "topicOld"='connect.action.timeline.milestone.transition.completed'
UPDATE "NotificationSettings" SET topic='connect.notification.project.product.update.spec' WHERE "topicOld"='connect.action.project.product.update.spec'
UPDATE "NotificationSettings" SET topic='connect.notification.project.created' WHERE "topicOld"='notifications.connect.project.created'
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.created' WHERE "topicOld"='notifications.connect.project.post.created'
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.active' WHERE "topicOld"='notifications.connect.project.phase.transition.active'
UPDATE "NotificationSettings" SET topic='connect.notification.project.approved' WHERE "topicOld"='notifications.connect.project.approved'
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.edited' WHERE "topicOld"='notifications.connect.project.post.edited'
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.updated' WHERE "topicOld"='connect.action.project.plan.updated'
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.created' WHERE "topicOld"='notifications.connect.project.topic.created'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.managerJoined' WHERE "topicOld"='notifications.connect.project.member.managerJoined'
UPDATE "NotificationSettings" SET topic='connect.notification.project.specificationModified' WHERE "topicOld"='notifications.connect.project.specificationModified'
UPDATE "NotificationSettings" SET topic='connect.notification.project.canceled' WHERE "topicOld"='notifications.connect.project.canceled'
UPDATE "NotificationSettings" SET topic='connect.notification.project.active' WHERE "topicOld"='notifications.connect.project.active'
UPDATE "NotificationSettings" SET topic='connect.notification.project.updated.spec' WHERE "topicOld"='connect.action.project.updated.spec'
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.payment' WHERE "topicOld"='notifications.connect.project.phase.update.payment'
UPDATE "NotificationSettings" SET topic='connect.notification.project.linkCreated' WHERE "topicOld"='notifications.connect.project.linkCreated'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.rejected' WHERE "topicOld"='notifications.connect.project.member.invite.rejected'
UPDATE "NotificationSettings" SET topic='connect.notification.project.completed' WHERE "topicOld"='notifications.connect.project.completed'
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.scope' WHERE "topicOld"='notifications.connect.project.phase.update.scope'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.requested' WHERE "topicOld"='notifications.connect.project.member.invite.requested'
UPDATE "NotificationSettings" SET topic='connect.notification.project.paused' WHERE "topicOld"='notifications.connect.project.paused'
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.ready' WHERE "topicOld"='connect.action.project.plan.ready'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.copilotJoined' WHERE "topicOld"='notifications.connect.project.member.copilotJoined'
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.deleted' WHERE "topicOld"='notifications.connect.project.topic.deleted'
UPDATE "NotificationSettings" SET topic='connect.notification.project.submittedForReview' WHERE "topicOld"='notifications.connect.project.submittedForReview'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.approved' WHERE "topicOld"='notifications.connect.project.member.invite.approved'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.assignedAsOwner' WHERE "topicOld"='notifications.connect.project.member.assignedAsOwner'
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.completed' WHERE "topicOld"='notifications.connect.project.phase.transition.completed'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.removed' WHERE "topicOld"='notifications.connect.project.member.removed'
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.active' WHERE "topicOld"='connect.action.timeline.milestone.transition.active'
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.waiting.customer' WHERE "topicOld"='connect.action.timeline.milestone.waiting.customer'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.joined' WHERE "topicOld"='notifications.connect.project.member.joined'
UPDATE "NotificationSettings" SET topic='connect.notification.project.fileUploaded' WHERE "topicOld"='notifications.connect.project.fileUploaded'
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.progress' WHERE "topicOld"='notifications.connect.project.phase.update.progress'
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.deleted' WHERE "topicOld"='notifications.connect.project.post.deleted'
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.left' WHERE "topicOld"='notifications.connect.project.member.left'
-- add "topic" column
ALTER TABLE "public"."NotificationSettings"
ADD COLUMN "topic" character varying(255) NOT NULL;
36 changes: 36 additions & 0 deletions migrations/v2.0.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.transition.completed' WHERE read='f' AND type='connect.action.timeline.milestone.transition.completed';
UPDATE "Notifications" SET type='connect.notification.project.product.update.spec' WHERE read='f' AND type='connect.action.project.product.update.spec';
UPDATE "Notifications" SET type='connect.notification.project.created' WHERE read='f' AND type='notifications.connect.project.created';
UPDATE "Notifications" SET type='connect.notification.project.post.created' WHERE read='f' AND type='notifications.connect.project.post.created';
UPDATE "Notifications" SET type='connect.notification.project.phase.transition.active' WHERE read='f' AND type='notifications.connect.project.phase.transition.active';
UPDATE "Notifications" SET type='connect.notification.project.approved' WHERE read='f' AND type='notifications.connect.project.approved';
UPDATE "Notifications" SET type='connect.notification.project.post.edited' WHERE read='f' AND type='notifications.connect.project.post.edited';
UPDATE "Notifications" SET type='connect.notification.project.plan.updated' WHERE read='f' AND type='connect.action.project.plan.updated';
UPDATE "Notifications" SET type='connect.notification.project.topic.created' WHERE read='f' AND type='notifications.connect.project.topic.created';
UPDATE "Notifications" SET type='connect.notification.project.member.managerJoined' WHERE read='f' AND type='notifications.connect.project.member.managerJoined';
UPDATE "Notifications" SET type='connect.notification.project.specificationModified' WHERE read='f' AND type='notifications.connect.project.specificationModified';
UPDATE "Notifications" SET type='connect.notification.project.canceled' WHERE read='f' AND type='notifications.connect.project.canceled';
UPDATE "Notifications" SET type='connect.notification.project.active' WHERE read='f' AND type='notifications.connect.project.active';
UPDATE "Notifications" SET type='connect.notification.project.updated.spec' WHERE read='f' AND type='connect.action.project.updated.spec';
UPDATE "Notifications" SET type='connect.notification.project.phase.update.payment' WHERE read='f' AND type='notifications.connect.project.phase.update.payment';
UPDATE "Notifications" SET type='connect.notification.project.linkCreated' WHERE read='f' AND type='notifications.connect.project.linkCreated';
UPDATE "Notifications" SET type='connect.notification.project.member.invite.rejected' WHERE read='f' AND type='notifications.connect.project.member.invite.rejected';
UPDATE "Notifications" SET type='connect.notification.project.completed' WHERE read='f' AND type='notifications.connect.project.completed';
UPDATE "Notifications" SET type='connect.notification.project.phase.update.scope' WHERE read='f' AND type='notifications.connect.project.phase.update.scope';
UPDATE "Notifications" SET type='connect.notification.project.member.invite.requested' WHERE read='f' AND type='notifications.connect.project.member.invite.requested';
UPDATE "Notifications" SET type='connect.notification.project.paused' WHERE read='f' AND type='notifications.connect.project.paused';
UPDATE "Notifications" SET type='connect.notification.project.plan.ready' WHERE read='f' AND type='connect.action.project.plan.ready';
UPDATE "Notifications" SET type='connect.notification.project.member.copilotJoined' WHERE read='f' AND type='notifications.connect.project.member.copilotJoined';
UPDATE "Notifications" SET type='connect.notification.project.topic.deleted' WHERE read='f' AND type='notifications.connect.project.topic.deleted';
UPDATE "Notifications" SET type='connect.notification.project.submittedForReview' WHERE read='f' AND type='notifications.connect.project.submittedForReview';
UPDATE "Notifications" SET type='connect.notification.project.member.invite.approved' WHERE read='f' AND type='notifications.connect.project.member.invite.approved';
UPDATE "Notifications" SET type='connect.notification.project.member.assignedAsOwner' WHERE read='f' AND type='notifications.connect.project.member.assignedAsOwner';
UPDATE "Notifications" SET type='connect.notification.project.phase.transition.completed' WHERE read='f' AND type='notifications.connect.project.phase.transition.completed';
UPDATE "Notifications" SET type='connect.notification.project.member.removed' WHERE read='f' AND type='notifications.connect.project.member.removed';
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.transition.active' WHERE read='f' AND type='connect.action.timeline.milestone.transition.active';
UPDATE "Notifications" SET type='connect.notification.project.timeline.milestone.waiting.customer' WHERE read='f' AND type='connect.action.timeline.milestone.waiting.customer';
UPDATE "Notifications" SET type='connect.notification.project.member.joined' WHERE read='f' AND type='notifications.connect.project.member.joined';
UPDATE "Notifications" SET type='connect.notification.project.fileUploaded' WHERE read='f' AND type='notifications.connect.project.fileUploaded';
UPDATE "Notifications" SET type='connect.notification.project.phase.update.progress' WHERE read='f' AND type='notifications.connect.project.phase.update.progress';
UPDATE "Notifications" SET type='connect.notification.project.post.deleted' WHERE read='f' AND type='notifications.connect.project.post.deleted';
UPDATE "Notifications" SET type='connect.notification.project.member.left' WHERE read='f' AND type='notifications.connect.project.member.left';
36 changes: 36 additions & 0 deletions migrations/v2.0.3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.completed' WHERE "topicOld"='connect.action.timeline.milestone.transition.completed';
UPDATE "NotificationSettings" SET topic='connect.notification.project.product.update.spec' WHERE "topicOld"='connect.action.project.product.update.spec';
UPDATE "NotificationSettings" SET topic='connect.notification.project.created' WHERE "topicOld"='notifications.connect.project.created';
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.created' WHERE "topicOld"='notifications.connect.project.post.created';
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.active' WHERE "topicOld"='notifications.connect.project.phase.transition.active';
UPDATE "NotificationSettings" SET topic='connect.notification.project.approved' WHERE "topicOld"='notifications.connect.project.approved';
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.edited' WHERE "topicOld"='notifications.connect.project.post.edited';
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.updated' WHERE "topicOld"='connect.action.project.plan.updated';
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.created' WHERE "topicOld"='notifications.connect.project.topic.created';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.managerJoined' WHERE "topicOld"='notifications.connect.project.member.managerJoined';
UPDATE "NotificationSettings" SET topic='connect.notification.project.specificationModified' WHERE "topicOld"='notifications.connect.project.specificationModified';
UPDATE "NotificationSettings" SET topic='connect.notification.project.canceled' WHERE "topicOld"='notifications.connect.project.canceled';
UPDATE "NotificationSettings" SET topic='connect.notification.project.active' WHERE "topicOld"='notifications.connect.project.active';
UPDATE "NotificationSettings" SET topic='connect.notification.project.updated.spec' WHERE "topicOld"='connect.action.project.updated.spec';
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.payment' WHERE "topicOld"='notifications.connect.project.phase.update.payment';
UPDATE "NotificationSettings" SET topic='connect.notification.project.linkCreated' WHERE "topicOld"='notifications.connect.project.linkCreated';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.rejected' WHERE "topicOld"='notifications.connect.project.member.invite.rejected';
UPDATE "NotificationSettings" SET topic='connect.notification.project.completed' WHERE "topicOld"='notifications.connect.project.completed';
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.scope' WHERE "topicOld"='notifications.connect.project.phase.update.scope';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.requested' WHERE "topicOld"='notifications.connect.project.member.invite.requested';
UPDATE "NotificationSettings" SET topic='connect.notification.project.paused' WHERE "topicOld"='notifications.connect.project.paused';
UPDATE "NotificationSettings" SET topic='connect.notification.project.plan.ready' WHERE "topicOld"='connect.action.project.plan.ready';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.copilotJoined' WHERE "topicOld"='notifications.connect.project.member.copilotJoined';
UPDATE "NotificationSettings" SET topic='connect.notification.project.topic.deleted' WHERE "topicOld"='notifications.connect.project.topic.deleted';
UPDATE "NotificationSettings" SET topic='connect.notification.project.submittedForReview' WHERE "topicOld"='notifications.connect.project.submittedForReview';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.invite.approved' WHERE "topicOld"='notifications.connect.project.member.invite.approved';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.assignedAsOwner' WHERE "topicOld"='notifications.connect.project.member.assignedAsOwner';
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.transition.completed' WHERE "topicOld"='notifications.connect.project.phase.transition.completed';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.removed' WHERE "topicOld"='notifications.connect.project.member.removed';
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.active' WHERE "topicOld"='connect.action.timeline.milestone.transition.active';
UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.waiting.customer' WHERE "topicOld"='connect.action.timeline.milestone.waiting.customer';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.joined' WHERE "topicOld"='notifications.connect.project.member.joined';
UPDATE "NotificationSettings" SET topic='connect.notification.project.fileUploaded' WHERE "topicOld"='notifications.connect.project.fileUploaded';
UPDATE "NotificationSettings" SET topic='connect.notification.project.phase.update.progress' WHERE "topicOld"='notifications.connect.project.phase.update.progress';
UPDATE "NotificationSettings" SET topic='connect.notification.project.post.deleted' WHERE "topicOld"='notifications.connect.project.post.deleted';
UPDATE "NotificationSettings" SET topic='connect.notification.project.member.left' WHERE "topicOld"='notifications.connect.project.member.left';