added 'trendingEligible' column in file db
This commit is contained in:
parent
58fd246117
commit
032066260b
2 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
})
|
||||
|
|
|
@ -39,6 +39,11 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {
|
|||
allowNull : false,
|
||||
defaultValue: false,
|
||||
},
|
||||
trendingEligible: {
|
||||
type : BOOLEAN,
|
||||
allowNull : false,
|
||||
defaultValue: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
freezeTableName: true,
|
||||
|
|
Loading…
Reference in a new issue