From d1981eb6c3ca366451a198a3c1a5c08e7dcda7a7 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 24 Oct 2017 19:36:37 -0400 Subject: [PATCH] note history snapshots now have date from and date to --- .../0006__date_modified_from_to_in_note_history.sql | 3 +++ migrations/0007__readd_encryption_to_note_history.sql | 1 + public/javascripts/note_history.js | 2 +- routes/api/note_history.js | 2 +- routes/api/notes.js | 8 +++++--- services/migration.js | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 migrations/0006__date_modified_from_to_in_note_history.sql create mode 100644 migrations/0007__readd_encryption_to_note_history.sql diff --git a/migrations/0006__date_modified_from_to_in_note_history.sql b/migrations/0006__date_modified_from_to_in_note_history.sql new file mode 100644 index 000000000..6bcbd4f2e --- /dev/null +++ b/migrations/0006__date_modified_from_to_in_note_history.sql @@ -0,0 +1,3 @@ +CREATE TABLE notes_history_mig AS SELECT id, note_id, note_title, note_text, date_modified AS date_modified_from, date_modified AS date_modified_to FROM notes_history; +DROP TABLE notes_history; +ALTER TABLE notes_history_mig RENAME TO notes_history; \ No newline at end of file diff --git a/migrations/0007__readd_encryption_to_note_history.sql b/migrations/0007__readd_encryption_to_note_history.sql new file mode 100644 index 000000000..b5ecfb3cb --- /dev/null +++ b/migrations/0007__readd_encryption_to_note_history.sql @@ -0,0 +1 @@ +ALTER TABLE notes_history ADD COLUMN encryption INTEGER DEFAULT 0 \ No newline at end of file diff --git a/public/javascripts/note_history.js b/public/javascripts/note_history.js index 2805355bc..62a56c2e3 100644 --- a/public/javascripts/note_history.js +++ b/public/javascripts/note_history.js @@ -21,7 +21,7 @@ function showNoteHistoryDialog(noteId, noteHistoryId) { globalHistoryItems = result; for (const row of result) { - const dateModified = getDateFromTS(row.date_modified); + const dateModified = getDateFromTS(row.date_modified_to); $("#note-history-list").append($('