more fixes to migration

This commit is contained in:
azivner 2017-10-22 20:29:31 -04:00
parent f49963dc67
commit 14625cc613
3 changed files with 16 additions and 15 deletions

View file

@ -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;

View file

@ -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])
});
});

View file

@ -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;