Optimize views sort sql query
This commit is contained in:
parent
6c9c3b7b14
commit
534556052e
|
@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const LAST_MIGRATION_VERSION = 605
|
||||
const LAST_MIGRATION_VERSION = 610
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
import * as Sequelize from 'sequelize'
|
||||
|
||||
async function up (utils: {
|
||||
transaction: Sequelize.Transaction
|
||||
queryInterface: Sequelize.QueryInterface
|
||||
sequelize: Sequelize.Sequelize
|
||||
db: any
|
||||
}): Promise<void> {
|
||||
|
||||
await utils.sequelize.query('DROP INDEX IF EXISTS video_views;')
|
||||
}
|
||||
|
||||
function down (options) {
|
||||
throw new Error('Not implemented.')
|
||||
}
|
||||
|
||||
export {
|
||||
up,
|
||||
down
|
||||
}
|
|
@ -426,7 +426,12 @@ export type AvailableForListIDsOptions = {
|
|||
]
|
||||
},
|
||||
{ fields: [ 'duration' ] },
|
||||
{ fields: [ 'views' ] },
|
||||
{
|
||||
fields: [
|
||||
{ name: 'views', order: 'DESC' },
|
||||
{ name: 'id', order: 'ASC' }
|
||||
]
|
||||
},
|
||||
{ fields: [ 'channelId' ] },
|
||||
{
|
||||
fields: [ 'originallyPublishedAt' ],
|
||||
|
|
Loading…
Reference in New Issue