this.form.patchValue(this.video.toJSON())
}
}
-
port: CONFIG.DATABASE.PORT,
benchmark: isTestInstance(),
isolationLevel: Sequelize.Transaction.ISOLATION_LEVELS.SERIALIZABLE,
+ operatorsAliases: false,
logging: (message: string, benchmark: number) => {
let newMessage = message
const options = {
where: {
id: {
- $in: ids
+ [Sequelize.Op.in]: ids
}
},
// In this case score is a literal and not an integer so we do not validate it
let start = Math.floor(Math.random() * count) - limit
if (start < 0) start = 0
+ const subQuery = `(SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins})`
const query = {
attributes: [ 'id' ],
order: [
limit: limit,
where: {
id: {
- $in: Sequelize.literal(`(SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins})`)
+ [Sequelize.Op.in]: Sequelize.literal(subQuery)
}
}
}
listBadPods = function () {
const query = {
where: {
- score: { $lte: 0 }
+ score: {
+ [Sequelize.Op.lte]: 0
+ }
}
}
const query = {
where: {
requestId: {
- $in: requestsIds
+ [Sequelize.Op.in]: requestsIds
},
podId: podId
}
model: RequestVideoEvent['sequelize'].models.Pod,
where: {
id: {
- $in: podIds
+ [Sequelize.Op.in]: podIds
}
}
}
const query = {
where: {
id: {
- $in: ids
+ [Sequelize.Op.in]: ids
}
},
include: [
model: RequestVideoQadu['sequelize'].models.Pod,
where: {
id: {
- $in: podIds
+ [Sequelize.Op.in]: podIds
}
}
},
const query = {
where: {
id: {
- $in: ids
+ [Sequelize.Op.in]: ids
},
podId
}
model: Request['sequelize'].models.Pod,
where: {
id: {
- $in: podIds
+ [Sequelize.Op.in]: podIds
}
}
}
const query = {
where: {
id: {
- $notIn: [
+ [Sequelize.Op.notIn]: [
Sequelize.literal('SELECT "requestId" FROM "RequestToPods"')
]
}
const query = {
include: [ { model: User['sequelize'].models.Author, required: true } ],
where: {
- $or: [ { username }, { email } ]
+ [Sequelize.Op.or]: [ { username }, { email } ]
}
}
}
} else if (field === 'tags') {
const escapedValue = Video['sequelize'].escape('%' + value + '%')
- query.where['id'].$in = Video['sequelize'].literal(
+ query.where['id'][Sequelize.Op.in] = Video['sequelize'].literal(
`(SELECT "VideoTags"."videoId"
FROM "Tags"
INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId"
// FIXME: Include our pod? (not stored in the database)
podInclude.where = {
host: {
- $iLike: '%' + value + '%'
+ [Sequelize.Op.iLike]: '%' + value + '%'
}
}
podInclude.required = true
} else if (field === 'author') {
authorInclude.where = {
name: {
- $iLike: '%' + value + '%'
+ [Sequelize.Op.iLike]: '%' + value + '%'
}
}
} else {
query.where[field] = {
- $iLike: '%' + value + '%'
+ [Sequelize.Op.iLike]: '%' + value + '%'
}
}
function createBaseVideosWhere () {
return {
id: {
- $notIn: Video['sequelize'].literal(
+ [Sequelize.Op.notIn]: Video['sequelize'].literal(
'(SELECT "BlacklistedVideos"."videoId" FROM "BlacklistedVideos")'
)
}