Fix case sentitivity in some MySQL instances #656

Merged
skhameneh merged 1 commit from trending-metrics into master 2018-10-24 23:22:51 +02:00
2 changed files with 2 additions and 2 deletions

View file

@ -65,7 +65,7 @@ module.exports = (sequelize, { BOOLEAN, DATE, FLOAT, INTEGER, STRING }) => {
const selectString = 'DISTINCT(claimId), weight';
const whereString = `isChannel = false and time > '${sqlTime}'`;
const query = `SELECT ${selectString} FROM trending WHERE ${whereString} ORDER BY weight DESC LIMIT ${limit}`
const query = `SELECT ${selectString} FROM Trending WHERE ${whereString} ORDER BY weight DESC LIMIT ${limit}`
return await sequelize.query(query, { type: sequelize.QueryTypes.SELECT });
};

View file

@ -48,7 +48,7 @@ module.exports = (sequelize, { BOOLEAN, DATE, STRING }) => {
const groupString = 'claimId, publisherId, isChannel';
return sequelize.query(
`SELECT ${selectString} FROM views where time > '${sqlTime}' GROUP BY ${groupString}`,
`SELECT ${selectString} FROM Views WHERE time > '${sqlTime}' GROUP BY ${groupString}`,
{ type: sequelize.QueryTypes.SELECT }
);
}