Add index on uploaded file ID
This commit is contained in:
parent
641699c092
commit
28289605a8
1 changed files with 9 additions and 0 deletions
|
@ -87,6 +87,7 @@ class FilesDB {
|
|||
...updateIndexes(),
|
||||
...createEntityDataTable(),
|
||||
...addAddedTime(),
|
||||
...addIndexOnUploadedID(),
|
||||
];
|
||||
|
||||
final dbConfig = MigrationConfig(
|
||||
|
@ -397,6 +398,14 @@ class FilesDB {
|
|||
];
|
||||
}
|
||||
|
||||
static List<String> addIndexOnUploadedID() {
|
||||
return [
|
||||
'''
|
||||
CREATE INDEX IF NOT EXISTS uploaded_file_id_index ON $filesTable($columnUploadedFileID);
|
||||
'''
|
||||
];
|
||||
}
|
||||
|
||||
Future<void> clearTable() async {
|
||||
final db = await instance.database;
|
||||
await db.delete(filesTable);
|
||||
|
|
Loading…
Add table
Reference in a new issue