From 3359484b15cf0caf2fb9ce848cc8ffc1663bba7d Mon Sep 17 00:00:00 2001 From: Deep Koluguri Date: Wed, 5 Nov 2025 11:19:29 -0500 Subject: [PATCH] db case issues --- backend/src/models/Notification.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/models/Notification.js b/backend/src/models/Notification.js index f3dab5a..6bba559 100644 --- a/backend/src/models/Notification.js +++ b/backend/src/models/Notification.js @@ -134,15 +134,16 @@ const Notification = sequelize.define('Notification', { }, { tableName: 'notifications', timestamps: true, + underscored: true, indexes: [ { - fields: ['user_id', 'createdAt'] + fields: ['user_id', 'created_at'] }, { fields: ['type', 'status'] }, { - fields: ['group_id', 'createdAt'] + fields: ['group_id', 'created_at'] }, { fields: ['status', 'scheduled_for'] @@ -209,7 +210,7 @@ Notification.getRecent = async function(userId, limit = 20) { return await this.findAll({ where: { user_id: userId }, - order: [['createdAt', 'DESC']], + order: [['created_at', 'DESC']], limit: limit, include: [ {