mirror of
https://github.com/zadam/trilium.git
synced 2025-02-27 00:29:21 +08:00
more fixes to migration
This commit is contained in:
parent
f49963dc67
commit
14625cc613
3 changed files with 16 additions and 15 deletions
|
@ -1,11 +1,11 @@
|
|||
DROP TABLE anchors;
|
||||
DROP TABLE attachments;
|
||||
DROP TABLE bookmarks;
|
||||
DROP TABLE custom_properties;
|
||||
DROP TABLE deletions;
|
||||
DROP TABLE deletions_attachments;
|
||||
DROP TABLE formatting;
|
||||
DROP TABLE icons;
|
||||
DROP TABLE tags;
|
||||
DROP TABLE tags_notes;
|
||||
DROP TABLE tasks;
|
||||
DROP TABLE IF EXISTS anchors;
|
||||
DROP TABLE IF EXISTS attachments;
|
||||
DROP TABLE IF EXISTS bookmarks;
|
||||
DROP TABLE IF EXISTS custom_properties;
|
||||
DROP TABLE IF EXISTS deletions;
|
||||
DROP TABLE IF EXISTS deletions_attachments;
|
||||
DROP TABLE IF EXISTS formatting;
|
||||
DROP TABLE IF EXISTS icons;
|
||||
DROP TABLE IF EXISTS tags;
|
||||
DROP TABLE IF EXISTS tags_notes;
|
||||
DROP TABLE IF EXISTS tasks;
|
|
@ -21,7 +21,6 @@ router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => {
|
|||
|
||||
res.send({
|
||||
'detail': detail,
|
||||
'links': await sql.getResults("select * from links where note_id = ? order by note_offset", [noteId]),
|
||||
'images': await sql.getResults("select * from images where note_id = ? order by note_offset", [noteId])
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,9 +22,9 @@ async function migrate() {
|
|||
const name = match[2];
|
||||
|
||||
const migrationRecord = {
|
||||
'db_version': dbVersion,
|
||||
'name': name,
|
||||
'file': file
|
||||
dbVersion: dbVersion,
|
||||
name: name,
|
||||
file: file
|
||||
};
|
||||
|
||||
migrations.push(migrationRecord);
|
||||
|
@ -44,6 +44,8 @@ async function migrate() {
|
|||
|
||||
await sql.executeScript(migrationSql);
|
||||
|
||||
await sql.setOption("db_version", mig.dbVersion);
|
||||
|
||||
await sql.commit();
|
||||
|
||||
mig['success'] = true;
|
||||
|
|
Loading…
Reference in a new issue