diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9bfeff8..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index bcff311..1979a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .idea ecosystem.config.js newrelic.js -newrelic_agent.log \ No newline at end of file +newrelic_agent.log +.DS_STORE \ No newline at end of file diff --git a/migrations/20190712083150-partialIndexToQuizQuestions.js b/migrations/20190712083150-partialIndexToQuizQuestions.js new file mode 100644 index 0000000..8e23bbc --- /dev/null +++ b/migrations/20190712083150-partialIndexToQuizQuestions.js @@ -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'); + */ + } +};