Skip to content

Commit 4b7990b

Browse files
authored
Merge pull request #799 from topcoder-platform/PM-589-add-migration
PM-589 add migration for fixing copilot request model
2 parents 0afeeac + 4adf1e9 commit 4b7990b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
up: async (queryInterface, Sequelize) => {
3+
await queryInterface.addColumn('copilot_requests', 'copilotOpportunityId', {
4+
type: Sequelize.BIGINT,
5+
allowNull: true,
6+
references: {
7+
model: 'copilot_opportunities',
8+
key: 'id',
9+
},
10+
onUpdate: 'CASCADE',
11+
onDelete: 'SET NULL',
12+
});
13+
},
14+
15+
down: async (queryInterface) => {
16+
await queryInterface.removeColumn('copilot_requests', 'copilotOpportunityId');
17+
},
18+
};

src/routes/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ router.get(`/${apiVersion}/projects/health`, (req, res) => {
2626
// List of public routes
2727
const publicRoutes = [
2828
`/${apiVersion}/projects/copilots/opportunities`,
29-
`/${apiVersion}/projects/copilot/opportunities/:id(\\d+)`,
29+
`/${apiVersion}/projects/copilot/opportunity/:id(\\d+)`,
3030
];
3131

3232
// All project service endpoints need authentication

0 commit comments

Comments
 (0)