From 1cc75ad3858c4f806d640ee79449815c6a55474c Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 22 Oct 2017 21:05:01 -0400 Subject: [PATCH] cleanup columns from notes table --- migrations/0002__cleanup_unused_columns_from_notes.sql | 3 +++ services/migration.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 migrations/0002__cleanup_unused_columns_from_notes.sql diff --git a/migrations/0002__cleanup_unused_columns_from_notes.sql b/migrations/0002__cleanup_unused_columns_from_notes.sql new file mode 100644 index 000000000..8f98a5d6a --- /dev/null +++ b/migrations/0002__cleanup_unused_columns_from_notes.sql @@ -0,0 +1,3 @@ +CREATE TABLE notes_mig AS SELECT note_id, note_title, note_text, note_clone_id, date_created, date_modified, encryption FROM notes; +DROP TABLE notes; +ALTER TABLE notes_mig RENAME TO notes; \ No newline at end of file diff --git a/services/migration.js b/services/migration.js index 05b89ecc1..7b4c5ffb8 100644 --- a/services/migration.js +++ b/services/migration.js @@ -2,7 +2,7 @@ const backup = require('./backup'); const sql = require('./sql'); const fs = require('fs-extra'); -const APP_DB_VERSION = 1; +const APP_DB_VERSION = 2; const MIGRATIONS_DIR = "./migrations"; async function migrate() {