Skip to content

kafka topic name change #145

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 5 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from 4 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
84 changes: 42 additions & 42 deletions connect/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,60 @@ module.exports = {
BUS_API_EVENT: {
CONNECT: {
POST: {
UPDATED: 'notifications.connect.project.post.edited',
CREATED: 'notifications.connect.project.post.created',
DELETED: 'notifications.connect.project.post.deleted',
MENTION: 'notifications.connect.project.post.mention',
UPDATED: 'connect.notification.project.post.edited',
CREATED: 'connect.notification.project.post.created',
DELETED: 'connect.notification.project.post.deleted',
MENTION: 'connect.notification.project.post.mention',
},
MEMBER: {
JOINED: 'notifications.connect.project.member.joined',
LEFT: 'notifications.connect.project.member.left',
REMOVED: 'notifications.connect.project.member.removed',
MANAGER_JOINED: 'notifications.connect.project.member.managerJoined',
COPILOT_JOINED: 'notifications.connect.project.member.copilotJoined',
ASSIGNED_AS_OWNER: 'notifications.connect.project.member.assignedAsOwner',
INVITE_CREATED: 'notifications.connect.project.member.invite.created',
INVITE_UPDATED: 'notifications.connect.project.member.invite.updated',
INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested',
INVITE_APPROVED: 'notifications.connect.project.member.invite.approved',
INVITE_REJECTED: 'notifications.connect.project.member.invite.rejected',
JOINED: 'connect.notification.project.member.joined',
LEFT: 'connect.notification.project.member.left',
REMOVED: 'connect.notification.project.member.removed',
MANAGER_JOINED: 'connect.notification.project.member.managerJoined',
COPILOT_JOINED: 'connect.notification.project.member.copilotJoined',
ASSIGNED_AS_OWNER: 'connect.notification.project.member.assignedAsOwner',
INVITE_CREATED: 'connect.notification.project.member.invite.created',
INVITE_UPDATED: 'connect.notification.project.member.invite.updated',
INVITE_REQUESTED: 'connect.notification.project.member.invite.requested',
INVITE_APPROVED: 'connect.notification.project.member.invite.approved',
INVITE_REJECTED: 'connect.notification.project.member.invite.rejected',
},
PROJECT: {
ACTIVE: 'notifications.connect.project.active',
APPROVED: 'notifications.connect.project.approved',
CANCELED: 'notifications.connect.project.canceled',
COMPLETED: 'notifications.connect.project.completed',
CREATED: 'notifications.connect.project.created',
FILE_UPLOADED: 'notifications.connect.project.fileUploaded',
LINK_CREATED: 'notifications.connect.project.linkCreated',
PAUSED: 'notifications.connect.project.paused',
SUBMITTED_FOR_REVIEW: 'notifications.connect.project.submittedForReview',
SPECIFICATION_MODIFIED: 'connect.action.project.updated.spec',
ACTIVE: 'connect.notification.project.active',
APPROVED: 'connect.notification.project.approved',
CANCELED: 'connect.notification.project.canceled',
COMPLETED: 'connect.notification.project.completed',
CREATED: 'connect.notification.project.created',
FILE_UPLOADED: 'connect.notification.project.fileUploaded',
LINK_CREATED: 'connect.notification.project.linkCreated',
PAUSED: 'connect.notification.project.paused',
SUBMITTED_FOR_REVIEW: 'connect.notification.project.submittedForReview',
SPECIFICATION_MODIFIED: 'connect.notification.project.updated.spec',
},
PROJECT_PLAN: {
READY: 'connect.action.project.plan.ready',
MODIFIED: 'connect.action.project.plan.updated',
PROGRESS_UPDATED: 'connect.action.project.updated.progress',
PHASE_ACTIVATED: 'notifications.connect.project.phase.transition.active',
PHASE_COMPLETED: 'notifications.connect.project.phase.transition.completed',
PHASE_PAYMENT_UPDATED: 'notifications.connect.project.phase.update.payment',
PHASE_PROGRESS_UPDATED: 'notifications.connect.project.phase.update.progress',
PHASE_SCOPE_UPDATED: 'notifications.connect.project.phase.update.scope',
PHASE_PRODUCT_SPEC_UPDATED: 'connect.action.project.product.update.spec',
MILESTONE_ACTIVATED: 'connect.action.timeline.milestone.transition.active',
MILESTONE_COMPLETED: 'connect.action.timeline.milestone.transition.completed',
WAITING_FOR_CUSTOMER_INPUT: 'connect.action.timeline.milestone.waiting.customer',
TIMELINE_ADJUSTED: 'connect.action.timeline.adjusted',
READY: 'connect.notification.project.plan.ready',
MODIFIED: 'connect.notification.project.plan.updated',
PROGRESS_UPDATED: 'connect.notification.project.updated.progress',
PHASE_ACTIVATED: 'connect.notification.project.phase.transition.active',
PHASE_COMPLETED: 'connect.notification.project.phase.transition.completed',
PHASE_PAYMENT_UPDATED: 'connect.notification.project.phase.update.payment',
PHASE_PROGRESS_UPDATED: 'connect.notification.project.phase.update.progress',
PHASE_SCOPE_UPDATED: 'connect.notification.project.phase.update.scope',
PHASE_PRODUCT_SPEC_UPDATED: 'connect.notification.project.product.update.spec',
MILESTONE_ACTIVATED: 'connect.notification.timeline.milestone.transition.active',
MILESTONE_COMPLETED: 'connect.notification.timeline.milestone.transition.completed',
WAITING_FOR_CUSTOMER_INPUT: 'connect.notification.timeline.milestone.waiting.customer',
TIMELINE_ADJUSTED: 'connect.notification.timeline.adjusted',
},
TOPIC: {
CREATED: 'notifications.connect.project.topic.created',
DELETED: 'notifications.connect.project.topic.deleted',
CREATED: 'connect.notification.project.topic.created',
DELETED: 'connect.notification.project.topic.deleted',
},
},
EMAIL: {
// TODO: after a proper named email topic is created, this is being used as the email event's topic
GENERAL: 'notifications.action.email.connect.project.notifications.generic',
BUNDLED: 'notifications.action.email.connect.project.notifications.bundled',
GENERAL: 'connect.notification.email.project.notifications.generic',
BUNDLED: 'connect.notification.email.project.notifications.bundled',
},
},
};
2 changes: 1 addition & 1 deletion constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {

BUS_API_EVENT: {
EMAIL: {
GENERAL: 'notifications.action.email.connect.project.notifications.generic',
GENERAL: 'connect.notification.email.project.notifications.generic',
},
},
};
44 changes: 44 additions & 0 deletions migrations/v2.0.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-- rename "topic" column to "topicOld"
ALTER TABLE "public"."NotificationSettings"
RENAME COLUMN "topic" TO "topicOld";

-- 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'
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'
1 change: 1 addition & 0 deletions src/models/NotificationSetting.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ module.exports = (sequelize, DataTypes) => sequelize.define('NotificationSetting
serviceId: { type: DataTypes.STRING, allowNull: false },
name: { type: DataTypes.STRING, allowNull: false },
value: { type: DataTypes.STRING, allowNull: false },
topicOld: { type: DataTypes.STRING, allowNull: false },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sachin-maheshwari do we need to keep the old topic name? I mean immediately after running the migration script, we can drop this column.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikasrohit No. This is just temporary, will clean later.

}, { timestamps: false });