1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

All: Allow attaching files of unknown mime type

This commit is contained in:
Laurent Cozic
2017-12-01 23:15:49 +00:00
parent aef2e4845d
commit dbeff4fd7d
8 changed files with 29 additions and 67 deletions

View File

@@ -202,7 +202,7 @@ class JoplinDatabase extends Database {
// default value and thus might cause problems. In that case, the default value
// must be set in the synchronizer too.
const existingDatabaseVersions = [0, 1, 2, 3, 4, 5, 6];
const existingDatabaseVersions = [0, 1, 2, 3, 4, 5, 6, 7];
let currentVersionIndex = existingDatabaseVersions.indexOf(fromVersion);
if (currentVersionIndex == existingDatabaseVersions.length - 1) return false;
@@ -228,7 +228,7 @@ class JoplinDatabase extends Database {
);
`;
queries.push({ sql: 'DROP TABLE deleted_items' });
// queries.push({ sql: 'DROP TABLE deleted_items' });
queries.push({ sql: this.sqlStringToLines(newTableSql)[0] });
queries.push({ sql: "CREATE INDEX deleted_items_sync_target ON deleted_items (sync_target)" });
}
@@ -259,6 +259,10 @@ class JoplinDatabase extends Database {
queries.push('CREATE INDEX alarm_note_id ON alarms (note_id)');
}
if (targetVersion == 7) {
queries.push('ALTER TABLE resources ADD COLUMN file_extension TEXT NOT NULL DEFAULT ""');
}
queries.push({ sql: 'UPDATE version SET version = ?', params: [targetVersion] });
await this.transactionExecBatch(queries);