added 'trendingEligible' column in file db

This commit is contained in:
bill bittner 2017-07-26 16:24:50 -07:00
parent 58fd246117
commit 032066260b
2 changed files with 6 additions and 1 deletions

View file

@ -147,7 +147,7 @@ module.exports = {
const deferred = new Promise((resolve, reject) => {
// get the raw requests data
db.sequelize
.query('SELECT COUNT(*), File.* FROM Request LEFT JOIN File ON Request.FileId = File.id WHERE FileId != "null" AND nsfw != 1 GROUP BY FileId ORDER BY COUNT(*) DESC LIMIT 25;', { type: db.sequelize.QueryTypes.SELECT })
.query('SELECT COUNT(*), File.* FROM Request LEFT JOIN File ON Request.FileId = File.id WHERE FileId != "null" AND nsfw != 1 AND trendingEligible = 1 GROUP BY FileId ORDER BY COUNT(*) DESC LIMIT 25;', { type: db.sequelize.QueryTypes.SELECT })
.then(results => {
resolve(results);
})

View file

@ -39,6 +39,11 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {
allowNull : false,
defaultValue: false,
},
trendingEligible: {
type : BOOLEAN,
allowNull : false,
defaultValue: true,
},
},
{
freezeTableName: true,