fix: prevent db from committing suicide
This commit is contained in:
parent
523359ec32
commit
0484ea74a2
|
@ -104,7 +104,6 @@ class QueryHelper {
|
|||
const subQ = db.table('fileTags')
|
||||
.select('fileTags.fileId')
|
||||
.join('tags', 'fileTags.tagId', '=', 'tags.id')
|
||||
.where('fileTags.fileId', db.ref('files.id'))
|
||||
.whereIn('tags.name', list)
|
||||
.groupBy('fileTags.fileId')
|
||||
.havingRaw('count(distinct tags.name) = ?', [list.length]);
|
||||
|
@ -116,7 +115,6 @@ class QueryHelper {
|
|||
const subQ = db.table('albumsFiles')
|
||||
.select('albumsFiles.fileId')
|
||||
.join('albums', 'albumsFiles.albumId', '=', 'albums.id')
|
||||
.where('albumsFiles.fileId', db.ref('files.id'))
|
||||
.whereIn('albums.name', list)
|
||||
.groupBy('albumsFiles.fileId')
|
||||
.havingRaw('count(distinct albums.name) = ?', [list.length]);
|
||||
|
@ -128,7 +126,6 @@ class QueryHelper {
|
|||
const subQ = db.table('fileTags')
|
||||
.select('fileTags.fileId')
|
||||
.join('tags', 'fileTags.tagId', '=', 'tags.id')
|
||||
.where('fileTags.fileId', db.ref('files.id'))
|
||||
.whereIn('tags.name', list);
|
||||
|
||||
return knex.whereNotIn('files.id', subQ);
|
||||
|
@ -138,7 +135,6 @@ class QueryHelper {
|
|||
const subQ = db.table('albumsFiles')
|
||||
.select('albumsFiles.fileId')
|
||||
.join('albums', 'albumsFiles.albumId', '=', 'albums.id')
|
||||
.where('albumsFiles.fileId', db.ref('files.id'))
|
||||
.whereIn('albums.name', list);
|
||||
|
||||
return knex.whereNotIn('files.id', subQ);
|
||||
|
|
Loading…
Reference in New Issue