Fix SQL query
This commit is contained in:
parent
5752683ea5
commit
65b2ec673d
3 changed files with 6 additions and 6 deletions
|
@ -311,7 +311,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
|
|||
if (t.host) {
|
||||
return {
|
||||
[Op.and]: [
|
||||
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
|
||||
ActorModel.wherePreferredUsername(t.name),
|
||||
{ $host$: t.host }
|
||||
]
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ export class ActorFollowModel extends Model<Partial<AttributesOnly<ActorFollowMo
|
|||
|
||||
return {
|
||||
[Op.and]: [
|
||||
ActorModel.wherePreferredUsername(t.name, '$preferredUsername$'),
|
||||
ActorModel.wherePreferredUsername(t.name),
|
||||
{ $serverId$: null }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
|
|||
const query = {
|
||||
where: {
|
||||
[Op.and]: [
|
||||
this.wherePreferredUsername(preferredUsername),
|
||||
this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
|
||||
{
|
||||
serverId: null
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ export class ActorModel extends Model<Partial<AttributesOnly<ActorModel>>> {
|
|||
|
||||
static loadByNameAndHost (preferredUsername: string, host: string): Promise<MActorFull> {
|
||||
const query = {
|
||||
where: this.wherePreferredUsername(preferredUsername),
|
||||
where: this.wherePreferredUsername(preferredUsername, '"ActorModel"."preferredUsername"'),
|
||||
include: [
|
||||
{
|
||||
model: ServerModel,
|
||||
|
|
|
@ -702,7 +702,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
|
|||
required: true,
|
||||
where: {
|
||||
[Op.and]: [
|
||||
ActorModel.wherePreferredUsername(name),
|
||||
ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
|
||||
{ serverId: null }
|
||||
]
|
||||
},
|
||||
|
@ -728,7 +728,7 @@ export class VideoChannelModel extends Model<Partial<AttributesOnly<VideoChannel
|
|||
{
|
||||
model: ActorModel,
|
||||
required: true,
|
||||
where: ActorModel.wherePreferredUsername(name),
|
||||
where: ActorModel.wherePreferredUsername(name, 'Actor.preferredUsername'),
|
||||
include: [
|
||||
{
|
||||
model: ServerModel,
|
||||
|
|
Loading…
Reference in a new issue