mirror of https://github.com/laurent22/joplin.git
add indexes
parent
7ade9b2948
commit
2022b5bc48
|
@ -18,6 +18,15 @@ export async function up(db: DbConnection): Promise<any> {
|
||||||
await db.schema.table('files', function(table: Knex.CreateTableBuilder) {
|
await db.schema.table('files', function(table: Knex.CreateTableBuilder) {
|
||||||
table.string('source_file_id', 32).defaultTo('').notNullable();
|
table.string('source_file_id', 32).defaultTo('').notNullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await db.schema.alterTable('files', function(table: Knex.CreateTableBuilder) {
|
||||||
|
table.index(['owner_id']);
|
||||||
|
table.index(['source_file_id']);
|
||||||
|
});
|
||||||
|
|
||||||
|
await db.schema.alterTable('changes', function(table: Knex.CreateTableBuilder) {
|
||||||
|
table.index(['item_id']);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function down(db: DbConnection): Promise<any> {
|
export async function down(db: DbConnection): Promise<any> {
|
|
@ -72,8 +72,6 @@ export default class ChangeModel extends BaseModel<Change> {
|
||||||
const directory = await fileModel.load(dirId);
|
const directory = await fileModel.load(dirId);
|
||||||
if (!directory.is_directory) throw new ErrorUnprocessableEntity(`Item with id "${dirId}" is not a directory.`);
|
if (!directory.is_directory) throw new ErrorUnprocessableEntity(`Item with id "${dirId}" is not a directory.`);
|
||||||
|
|
||||||
// TODO: Add indexes
|
|
||||||
|
|
||||||
// Retrieves the IDs of all the files that have been shared with the
|
// Retrieves the IDs of all the files that have been shared with the
|
||||||
// current user.
|
// current user.
|
||||||
const linkedFilesQuery = this
|
const linkedFilesQuery = this
|
||||||
|
|
Loading…
Reference in New Issue