Skip to content
Open
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
Binary file removed .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.idea
ecosystem.config.js
newrelic.js
newrelic_agent.log
newrelic_agent.log
.DS_STORE
25 changes: 25 additions & 0 deletions migrations/20190712083150-partialIndexToQuizQuestions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addIndex('quizQuestions', {
name: "quizQuestions_quizId_questionsid_partialIndex",
fields: ["quizId", "questionId"],
unique: "id",
where: {
deletedAt: null
}
})
await queryInterface.removeConstraint('quizQuestions', 'quizQuestions_questionId_quizId_key')
},

down: (queryInterface, Sequelize) => {
/*
Add reverting commands here.
Return a promise to correctly handle asynchronicity.

Example:
return queryInterface.dropTable('users');
*/
}
};