db case issues
This commit is contained in:
parent
a305fd0190
commit
3359484b15
|
|
@ -134,15 +134,16 @@ const Notification = sequelize.define('Notification', {
|
||||||
}, {
|
}, {
|
||||||
tableName: 'notifications',
|
tableName: 'notifications',
|
||||||
timestamps: true,
|
timestamps: true,
|
||||||
|
underscored: true,
|
||||||
indexes: [
|
indexes: [
|
||||||
{
|
{
|
||||||
fields: ['user_id', 'createdAt']
|
fields: ['user_id', 'created_at']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fields: ['type', 'status']
|
fields: ['type', 'status']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fields: ['group_id', 'createdAt']
|
fields: ['group_id', 'created_at']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fields: ['status', 'scheduled_for']
|
fields: ['status', 'scheduled_for']
|
||||||
|
|
@ -209,7 +210,7 @@ Notification.getRecent = async function(userId, limit = 20) {
|
||||||
|
|
||||||
return await this.findAll({
|
return await this.findAll({
|
||||||
where: { user_id: userId },
|
where: { user_id: userId },
|
||||||
order: [['createdAt', 'DESC']],
|
order: [['created_at', 'DESC']],
|
||||||
limit: limit,
|
limit: limit,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue