From b2627fd8170fa58e3cd76a5d797bb45461c08031 Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 6 Aug 2019 15:01:29 +0530 Subject: [PATCH 1/3] SQL changes --- migrations/v2.0.1.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migrations/v2.0.1.sql b/migrations/v2.0.1.sql index 76e5a71..9423bcf 100644 --- a/migrations/v2.0.1.sql +++ b/migrations/v2.0.1.sql @@ -2,10 +2,14 @@ ALTER TABLE "public"."NotificationSettings" RENAME COLUMN "topic" TO "topicOld"; + ALTER TABLE "public"."NotificationSettings" + ALTER COLUMN "topicOld" DROP NOT NULL; + -- add "topic" column ALTER TABLE "public"."NotificationSettings" ADD COLUMN "topic" character varying(255); + 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' From 92105c08b49ba88e32bb1d852209b3048139f10d Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Tue, 6 Aug 2019 16:58:51 +0530 Subject: [PATCH 2/3] SQL: adding not null constraint. --- migrations/v2.0.1.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/v2.0.1.sql b/migrations/v2.0.1.sql index 9423bcf..dc77d8d 100644 --- a/migrations/v2.0.1.sql +++ b/migrations/v2.0.1.sql @@ -7,7 +7,7 @@ -- add "topic" column ALTER TABLE "public"."NotificationSettings" - ADD COLUMN "topic" character varying(255); + ADD COLUMN "topic" character varying(255) NOT NULL; UPDATE "NotificationSettings" SET topic='connect.notification.project.timeline.milestone.transition.completed' WHERE "topicOld"='connect.action.timeline.milestone.transition.completed' From 20cd91a3d285acbe73c5e5a60f3ad118a6b94fff Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Mon, 19 Aug 2019 15:22:59 +0530 Subject: [PATCH 3/3] adding DB changes --- migrations/v2.0.1.sql | 38 -------------------------------------- migrations/v2.0.2.sql | 36 ++++++++++++++++++++++++++++++++++++ migrations/v2.0.3.sql | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 38 deletions(-) create mode 100644 migrations/v2.0.2.sql create mode 100644 migrations/v2.0.3.sql diff --git a/migrations/v2.0.1.sql b/migrations/v2.0.1.sql index dc77d8d..c745f07 100644 --- a/migrations/v2.0.1.sql +++ b/migrations/v2.0.1.sql @@ -8,41 +8,3 @@ -- add "topic" column ALTER TABLE "public"."NotificationSettings" ADD COLUMN "topic" character varying(255) 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' diff --git a/migrations/v2.0.2.sql b/migrations/v2.0.2.sql new file mode 100644 index 0000000..9de9358 --- /dev/null +++ b/migrations/v2.0.2.sql @@ -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'; \ No newline at end of file diff --git a/migrations/v2.0.3.sql b/migrations/v2.0.3.sql new file mode 100644 index 0000000..4ace7e8 --- /dev/null +++ b/migrations/v2.0.3.sql @@ -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';