Merge c0b380bbf5
into 18d66c0233
This commit is contained in:
commit
fe2c3eb209
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class OptimizeDriveFilesQuery1756824506000 {
|
||||||
|
name = 'OptimizeDriveFilesQuery1756824506000'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
// Create optimized composite index for drive files query performance
|
||||||
|
await queryRunner.query(`DROP INDEX "IDX_860fa6f6c7df5bb887249fba22"`);
|
||||||
|
await queryRunner.query(`CREATE INDEX "IDX_a76118b66adb3228e0ee69c281" ON "drive_file" ("userId", "id" DESC)`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`DROP INDEX "IDX_a76118b66adb3228e0ee69c281"`);
|
||||||
|
await queryRunner.query(`CREATE INDEX "IDX_860fa6f6c7df5bb887249fba22" ON "drive_file" ("userId")`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,11 +10,11 @@ import { MiDriveFolder } from './DriveFolder.js';
|
||||||
|
|
||||||
@Entity('drive_file')
|
@Entity('drive_file')
|
||||||
@Index(['userId', 'folderId', 'id'])
|
@Index(['userId', 'folderId', 'id'])
|
||||||
|
@Index(['userId', 'id'])
|
||||||
export class MiDriveFile {
|
export class MiDriveFile {
|
||||||
@PrimaryColumn(id())
|
@PrimaryColumn(id())
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
||||||
@Index()
|
|
||||||
@Column({
|
@Column({
|
||||||
...id(),
|
...id(),
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
Loading…
Reference in New Issue