Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

suplement: optimize the db query #193

Merged
merged 2 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/api/v1/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Files {
: 'files.user_id = :user', {
user: shared ? req.user?.username : req.user?.id })
.andWhere(buildWhereQuery(filters, 'files.') || 'true')
.leftJoin('files.parent', 'parent')
// .leftJoin('files.parent', 'parent')
.skip(Number(offset) || undefined)
.take(Number(limit) || undefined)
.orderBy(buildSort(sort as string, 'files.'))
Expand Down
2 changes: 1 addition & 1 deletion server/src/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const runDB = async (): Promise<void> => {
rejectUnauthorized: false
} : false,
schema: 'public',
synchronize: true,
synchronize: false,
logging: true,
entities: [`${__dirname}/entities/*.js`],
subscribers: [`${__dirname}/subscriber/*.js`],
Expand Down