Skip to content

Commit

Permalink
perf: misc enhancements (#10550)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Dec 19, 2024
1 parent 7b4d82a commit 83ba678
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions migrations/20241218093842-confirm-email-token-index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addIndex('Users', ['emailConfirmationToken'], {
unique: true,
where: {
deletedAt: { [Sequelize.Op.eq]: null },
emailConfirmationToken: { [Sequelize.Op.ne]: null },
},
});
},

async down(queryInterface, Sequelize) {
await queryInterface.removeIndex('Users', ['emailConfirmationToken']);
},
};
1 change: 1 addition & 0 deletions server/graphql/loaders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ export const loaders = req => {
AND "Transaction"."RefundTransactionId" IS NULL
AND "Transaction"."type" = 'CREDIT'
AND "Transaction"."kind" IN ('CONTRIBUTION', 'ADDED_FUNDS')
AND "Transaction"."deletedAt" IS NULL
GROUP BY "Order"."TierId";
`,
{
Expand Down
2 changes: 2 additions & 0 deletions server/lib/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ const getGiftCardBatchesForCollective = async collectiveId => {
FROM "PaymentMethods" pm
INNER JOIN "PaymentMethods" spm ON pm."SourcePaymentMethodId" = spm.id
WHERE spm."CollectiveId" = :collectiveId
AND pm."deletedAt" IS NULL
AND spm."deletedAt" IS NULL
GROUP BY pm.batch
ORDER BY pm.batch ASC
`,
Expand Down

0 comments on commit 83ba678

Please sign in to comment.