Video get SQL optimization

pull/232/head
Chocobozzz 2018-01-18 17:44:04 +01:00
parent 2c897999fe
commit 3e5002477a
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 15 additions and 7 deletions

View File

@ -127,22 +127,30 @@ enum ScopeNames {
attributes: {
exclude: [ 'privateKey', 'publicKey' ]
},
model: () => ActorModel,
required: true
},
{
model: () => AccountModel,
model: () => ActorModel.unscoped(),
required: true,
include: [
{
model: () => ActorModel,
attributes: [ 'host' ],
model: () => ServerModel.unscoped(),
required: false
}
]
},
{
model: () => AccountModel.unscoped(),
required: true,
include: [
{
model: () => ActorModel.unscoped(),
attributes: {
exclude: [ 'privateKey', 'publicKey' ]
},
required: true,
include: [
{
model: () => ServerModel,
attributes: [ 'host' ],
model: () => ServerModel.unscoped(),
required: false
}
]