Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
removed (112) migrations originating before first public release (0.20 in Sept 2018)
zadamcd3f8a41af6e
diff --git a/db/migrations/0001__cleanup_tables.sql b/db/migrations/0001__cleanup_tables.sqldeleted file mode 100644index 89b7355c50..0000000000--- a/db/migrations/0001__cleanup_tables.sql+++ /dev/null@@ -1,11 +0,0 @@-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;\ No newline at end of filediff --git a/db/migrations/0002__cleanup_unused_columns_from_notes.sql b/db/migrations/0002__cleanup_unused_columns_from_notes.sqldeleted file mode 100644index 8f98a5d6a8..0000000000--- a/db/migrations/0002__cleanup_unused_columns_from_notes.sql+++ /dev/null@@ -1,3 +0,0 @@-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 filediff --git a/db/migrations/0003__add_is_deleted_to_note.sql b/db/migrations/0003__add_is_deleted_to_note.sqldeleted file mode 100644index 8ba0afa7dc..0000000000--- a/db/migrations/0003__add_is_deleted_to_note.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes ADD COLUMN is_deleted INTEGER NOT NULL DEFAULT 0\ No newline at end of filediff --git a/db/migrations/0004__add_date_modified_to_notes_tree.sql b/db/migrations/0004__add_date_modified_to_notes_tree.sqldeleted file mode 100644index c914bd1c78..0000000000--- a/db/migrations/0004__add_date_modified_to_notes_tree.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes_tree ADD COLUMN date_modified INTEGER NOT NULL DEFAULT 0\ No newline at end of filediff --git a/db/migrations/0005__cleanup_options.sql b/db/migrations/0005__cleanup_options.sqldeleted file mode 100644index 1832f28e91..0000000000--- a/db/migrations/0005__cleanup_options.sql+++ /dev/null@@ -1 +0,0 @@-DELETE FROM options WHERE opt_name IN ('is_readonly', 'prop_modified', 'doc_title', 'doc_UID', 'format_version', 'flask_secret_key')\ No newline at end of filediff --git a/db/migrations/0006__date_modified_from_to_in_note_history.sql b/db/migrations/0006__date_modified_from_to_in_note_history.sqldeleted file mode 100644index 6bcbd4f2ea..0000000000--- a/db/migrations/0006__date_modified_from_to_in_note_history.sql+++ /dev/null@@ -1,3 +0,0 @@-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 filediff --git a/db/migrations/0007__readd_encryption_to_note_history.sql b/db/migrations/0007__readd_encryption_to_note_history.sqldeleted file mode 100644index b5ecfb3cba..0000000000--- a/db/migrations/0007__readd_encryption_to_note_history.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes_history ADD COLUMN encryption INTEGER DEFAULT 0\ No newline at end of filediff --git a/db/migrations/0008__fix_note_history.sql b/db/migrations/0008__fix_note_history.sqldeleted file mode 100644index fa71edf37e..0000000000--- a/db/migrations/0008__fix_note_history.sql+++ /dev/null@@ -1,15 +0,0 @@-CREATE TABLE `notes_history_mig` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,- `note_id` INT,- `note_title` TEXT,- `note_text` TEXT,- `date_modified_from` INT,- `date_modified_to` INT,- `encryption` INTEGER DEFAULT 0-);--INSERT INTO notes_history (id, note_id, note_title, note_text, date_modified_from, date_modified_to, encryption)- SELECT id, note_id, note_title, note_text, date_modified_from, date_modified_to, encryption FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;\ No newline at end of filediff --git a/db/migrations/0009__indexes.sql b/db/migrations/0009__indexes.sqldeleted file mode 100644index b427a9337e..0000000000--- a/db/migrations/0009__indexes.sql+++ /dev/null@@ -1,41 +0,0 @@-CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);--CREATE INDEX `IDX_images_note_id` ON `images` (- `note_id`-);--CREATE INDEX `IDX_links_note_id` ON `links` (- `note_id`-);--CREATE INDEX `IDX_audit_log_note_id` ON `audit_log` (- `note_id`-);--CREATE INDEX `IDX_audit_log_date_modified` ON `audit_log` (- `date_modified`-);--CREATE TABLE `notes_mig` (- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `note_clone_id` TEXT,- `date_created` INT,- `date_modified` INT,- `encryption` INT,- `is_deleted` INTEGER NOT NULL DEFAULT 0,- PRIMARY KEY(`note_id`)-);--INSERT INTO notes_mig (note_id, note_title, note_text, note_clone_id, date_created, date_modified, encryption)- 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;--CREATE INDEX `IDX_notes_is_deleted` ON `notes` (- `is_deleted`-);\ No newline at end of filediff --git a/db/migrations/0010__add_is_deleted_to_notes_tree.sql b/db/migrations/0010__add_is_deleted_to_notes_tree.sqldeleted file mode 100644index 53d7040ee8..0000000000--- a/db/migrations/0010__add_is_deleted_to_notes_tree.sql+++ /dev/null@@ -1,5 +0,0 @@-ALTER TABLE notes_tree ADD COLUMN is_deleted INTEGER NOT NULL DEFAULT 0;--CREATE INDEX `IDX_notes_tree_is_deleted` ON `notes_tree` (- `is_deleted`-);\ No newline at end of filediff --git a/db/migrations/0011__add_last_synced_option.sql b/db/migrations/0011__add_last_synced_option.sqldeleted file mode 100644index 7bdf470281..0000000000--- a/db/migrations/0011__add_last_synced_option.sql+++ /dev/null@@ -1 +0,0 @@-INSERT INTO options (opt_name, opt_value) VALUES ('last_synced', 0)\ No newline at end of filediff --git a/db/migrations/0012__create_index_on_notes_history.sql b/db/migrations/0012__create_index_on_notes_history.sqldeleted file mode 100644index 235884a792..0000000000--- a/db/migrations/0012__create_index_on_notes_history.sql+++ /dev/null@@ -1,5 +0,0 @@-CREATE UNIQUE INDEX `IDX_notes_history_note_from_to` ON `notes_history` (- `note_id`,- `date_modified_from`,- `date_modified_to`-);\ No newline at end of filediff --git a/db/migrations/0013__last_sync_pulled_pushed.sql b/db/migrations/0013__last_sync_pulled_pushed.sqldeleted file mode 100644index 060e076df4..0000000000--- a/db/migrations/0013__last_sync_pulled_pushed.sql+++ /dev/null@@ -1,3 +0,0 @@-UPDATE options SET opt_name = 'last_synced_pull' WHERE opt_name = 'last_synced';--INSERT INTO options (opt_name, opt_value) VALUES ('last_synced_push', 0);\ No newline at end of filediff --git a/db/migrations/0014__change_audit_log_id.sql b/db/migrations/0014__change_audit_log_id.sqldeleted file mode 100644index c553ecfd01..0000000000--- a/db/migrations/0014__change_audit_log_id.sql+++ /dev/null@@ -1,16 +0,0 @@-CREATE TABLE `audit_log_mig` (- `id` TEXT NOT NULL PRIMARY KEY,- `date_modified` INTEGER NOT NULL,- `category` TEXT NOT NULL,- `browser_id` TEXT,- `note_id` TEXT,- `change_from` TEXT,- `change_to` TEXT,- `comment` TEXT-);--INSERT INTO audit_log_mig (id, date_modified, category, browser_id, note_id, change_from, change_to)- SELECT id, date_modified, category, browser_id, note_id, change_from, change_to FROM audit_log;--DROP TABLE audit_log;-ALTER TABLE audit_log_mig RENAME TO audit_log;\ No newline at end of filediff --git a/db/migrations/0015__trim_note_ids.sql b/db/migrations/0015__trim_note_ids.sqldeleted file mode 100644index 3b981d1729..0000000000--- a/db/migrations/0015__trim_note_ids.sql+++ /dev/null@@ -1,6 +0,0 @@-UPDATE notes SET note_id = substr(note_id, 0, 22);-UPDATE notes_tree SET note_id = substr(note_id, 0, 22), note_pid = substr(note_pid, 0, 22);-UPDATE notes_history SET note_id = substr(note_id, 0, 22);-UPDATE audit_log SET note_id = substr(note_id, 0, 22);-UPDATE links SET note_id = substr(note_id, 0, 22);-UPDATE images SET note_id = substr(note_id, 0, 22);\ No newline at end of filediff --git a/db/migrations/0016__trim_note_ids2.sql b/db/migrations/0016__trim_note_ids2.sqldeleted file mode 100644index ad2772fa09..0000000000--- a/db/migrations/0016__trim_note_ids2.sql+++ /dev/null@@ -1,6 +0,0 @@-UPDATE notes SET note_id = substr(note_id, 0, 13);-UPDATE notes_tree SET note_id = substr(note_id, 0, 13), note_pid = substr(note_pid, 0, 13);-UPDATE notes_history SET note_id = substr(note_id, 0, 13);-UPDATE audit_log SET note_id = substr(note_id, 0, 13);-UPDATE links SET note_id = substr(note_id, 0, 13);-UPDATE images SET note_id = substr(note_id, 0, 13);\ No newline at end of filediff --git a/db/migrations/0017__document_id.sql b/db/migrations/0017__document_id.sqldeleted file mode 100644index 9bced5a9b7..0000000000--- a/db/migrations/0017__document_id.sql+++ /dev/null@@ -1 +0,0 @@-INSERT INTO options (opt_name, opt_value) VALUES ('document_id', '');\ No newline at end of filediff --git a/db/migrations/0018__document_secret.sql b/db/migrations/0018__document_secret.sqldeleted file mode 100644index 67c59df4e5..0000000000--- a/db/migrations/0018__document_secret.sql+++ /dev/null@@ -1 +0,0 @@-INSERT INTO options (opt_name, opt_value) VALUES ('document_secret', '');\ No newline at end of filediff --git a/db/migrations/0019__date_modified_for_options.sql b/db/migrations/0019__date_modified_for_options.sqldeleted file mode 100644index 47684ba97f..0000000000--- a/db/migrations/0019__date_modified_for_options.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE options ADD COLUMN date_modified INTEGER NOT NULL DEFAULT 0\ No newline at end of filediff --git a/db/migrations/0020__sync.sql b/db/migrations/0020__sync.sqldeleted file mode 100644index e5d76f0cce..0000000000--- a/db/migrations/0020__sync.sql+++ /dev/null@@ -1,15 +0,0 @@-CREATE TABLE `sync` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `entity_name` TEXT NOT NULL,- `entity_id` TEXT NOT NULL,- `sync_date` INTEGER NOT NULL-);--CREATE UNIQUE INDEX `IDX_sync_entity_name_id` ON `sync` (- `entity_name`,- `entity_id`-);--CREATE INDEX `IDX_sync_sync_date` ON `sync` (- `sync_date`-);\ No newline at end of filediff --git a/db/migrations/0021__sync_add_source_id.sql b/db/migrations/0021__sync_add_source_id.sqldeleted file mode 100644index 59315fbf4e..0000000000--- a/db/migrations/0021__sync_add_source_id.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE sync ADD COLUMN source_id TEXT\ No newline at end of filediff --git a/db/migrations/0022__add_note_history_id.sql b/db/migrations/0022__add_note_history_id.sqldeleted file mode 100644index f472955526..0000000000--- a/db/migrations/0022__add_note_history_id.sql+++ /dev/null@@ -1,7 +0,0 @@-ALTER TABLE notes_history ADD COLUMN note_history_id TEXT;--UPDATE notes_history SET note_history_id = id;--CREATE UNIQUE INDEX `IDX_note_history_note_history_id` ON `notes_history` (- `note_history_id`-);\ No newline at end of filediff --git a/db/migrations/0023__remove_id_from_note_history.sql b/db/migrations/0023__remove_id_from_note_history.sqldeleted file mode 100644index 01902b57ce..0000000000--- a/db/migrations/0023__remove_id_from_note_history.sql+++ /dev/null@@ -1,27 +0,0 @@-CREATE TABLE `notes_history_mig` (- `note_history_id` TEXT NOT NULL PRIMARY KEY,- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `encryption` INT,- `date_modified_from` INT,- `date_modified_to` INT-);--INSERT INTO notes_history_mig (note_history_id, note_id, note_title, note_text, encryption, date_modified_from, date_modified_to)- SELECT note_history_id, note_id, note_title, note_text, encryption, date_modified_from, date_modified_to FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;--CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);--CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` (- `date_modified_from`-);--CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` (- `date_modified_to`-);\ No newline at end of filediff --git a/db/migrations/0024__remove_id_from_options.sql b/db/migrations/0024__remove_id_from_options.sqldeleted file mode 100644index 68dfc97857..0000000000--- a/db/migrations/0024__remove_id_from_options.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE `options_mig` (- `opt_name` TEXT NOT NULL PRIMARY KEY,- `opt_value` TEXT,- `date_modified` INT-);--INSERT INTO options_mig (opt_name, opt_value, date_modified)- SELECT opt_name, opt_value, date_modified FROM options;--DROP TABLE options;-ALTER TABLE options_mig RENAME TO options;diff --git a/db/migrations/0025__create_event_log.sql b/db/migrations/0025__create_event_log.sqldeleted file mode 100644index ea22282b4b..0000000000--- a/db/migrations/0025__create_event_log.sql+++ /dev/null@@ -1,10 +0,0 @@-CREATE TABLE `event_log` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `note_id` TEXT,- `comment` TEXT,- `date_added` INTEGER NOT NULL-);--CREATE INDEX `IDX_event_log_date_added` ON `event_log` (- `date_added`-);\ No newline at end of filediff --git a/db/migrations/0026__recent_notes_table.sql b/db/migrations/0026__recent_notes_table.sqldeleted file mode 100644index e7a621e0a5..0000000000--- a/db/migrations/0026__recent_notes_table.sql+++ /dev/null@@ -1,4 +0,0 @@-CREATE TABLE `recent_notes` (- `note_id` TEXT NOT NULL PRIMARY KEY,- `date_accessed` INTEGER NOT NULL-);\ No newline at end of filediff --git a/db/migrations/0027__is_deleted_in_recent_notes.sql b/db/migrations/0027__is_deleted_in_recent_notes.sqldeleted file mode 100644index ddf4d293ca..0000000000--- a/db/migrations/0027__is_deleted_in_recent_notes.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE recent_notes ADD COLUMN is_deleted INT;\ No newline at end of filediff --git a/db/migrations/0028__rename_encryption_to_protected.sql b/db/migrations/0028__rename_encryption_to_protected.sqldeleted file mode 100644index 76859827a5..0000000000--- a/db/migrations/0028__rename_encryption_to_protected.sql+++ /dev/null@@ -1,52 +0,0 @@-UPDATE audit_log SET category = 'PROTECTED' WHERE category = 'ENCRYPTION';--DELETE FROM notes WHERE note_clone_id IS NOT NULL AND note_clone_id != '';--CREATE TABLE `notes_mig` (- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `date_created` INT,- `date_modified` INT,- `is_protected` INT NOT NULL DEFAULT 0,- `is_deleted` INT NOT NULL DEFAULT 0,- PRIMARY KEY(`note_id`)-);--INSERT INTO notes_mig (note_id, note_title, note_text, date_created, date_modified, is_protected, is_deleted)- SELECT note_id, note_title, note_text, date_created, date_modified, encryption, is_deleted FROM notes;--DROP TABLE notes;-ALTER TABLE notes_mig RENAME TO notes;--CREATE INDEX `IDX_notes_is_deleted` ON `notes` (- `is_deleted`-);--CREATE TABLE `notes_history_mig` (- `note_history_id` TEXT NOT NULL PRIMARY KEY,- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT,- `date_modified_from` INT,- `date_modified_to` INT-);--INSERT INTO notes_history_mig (note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to)- SELECT note_history_id, note_id, note_title, note_text, encryption, date_modified_from, date_modified_to FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;--CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);--CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` (- `date_modified_from`-);--CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` (- `date_modified_to`-);\ No newline at end of filediff --git a/db/migrations/0029__rename_encryption_session_timeout_to_protected_session_timeout.sql b/db/migrations/0029__rename_encryption_session_timeout_to_protected_session_timeout.sqldeleted file mode 100644index 88fe48497c..0000000000--- a/db/migrations/0029__rename_encryption_session_timeout_to_protected_session_timeout.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE options SET opt_name = 'protected_session_timeout' WHERE opt_name = 'encryption_session_timeout';\ No newline at end of filediff --git a/db/migrations/0030__hello_world.js b/db/migrations/0030__hello_world.jsdeleted file mode 100644index 15695bf879..0000000000--- a/db/migrations/0030__hello_world.js+++ /dev/null@@ -1 +0,0 @@-module.exports = async () => console.log("heeeelllooo!!!");\ No newline at end of filediff --git a/db/migrations/0031__change_encryption_to_CBC.js b/db/migrations/0031__change_encryption_to_CBC.jsdeleted file mode 100644index 346d45afc8..0000000000--- a/db/migrations/0031__change_encryption_to_CBC.js+++ /dev/null@@ -1,44 +0,0 @@-const sql = require('../services/sql');-const data_encryption = require('../services/data_encryption');-const password_encryption = require('../services/password_encryption');-const readline = require('readline');--const cl = readline.createInterface(process.stdin, process.stdout);--function question(q) {- return new Promise( (res, rej) => {- cl.question( q, answer => {- res(answer);- })- });-}--module.exports = async () => {- const password = await question("Enter password: ");- const dataKey = await password_encryption.getDecryptedDataKey(password);-- const protectedNotes = await sql.getRows("SELECT * FROM notes WHERE is_protected = 1");-- for (const note of protectedNotes) {- const decryptedTitle = data_encryption.decrypt(dataKey, note.note_title);-- note.note_title = data_encryption.encrypt(dataKey, "0" + note.note_id, decryptedTitle);-- const decryptedText = data_encryption.decrypt(dataKey, note.note_text);- note.note_text = data_encryption.encrypt(dataKey, "1" + note.note_id, decryptedText);-- await sql.execute("UPDATE notes SET note_title = ?, note_text = ? WHERE note_id = ?", [note.note_title, note.note_text, note.note_id]);- }-- const protectedNotesHistory = await sql.getRows("SELECT * FROM notes_history WHERE is_protected = 1");-- for (const noteHistory of protectedNotesHistory) {- const decryptedTitle = data_encryption.decrypt(dataKey, noteHistory.note_title);- noteHistory.note_title = data_encryption.encrypt(dataKey, "0" + noteHistory.note_history_id, decryptedTitle);-- const decryptedText = data_encryption.decrypt(dataKey, noteHistory.note_text);- noteHistory.note_text = data_encryption.encrypt(dataKey, "1" + noteHistory.note_history_id, decryptedText);-- await sql.execute("UPDATE notes SET note_title = ?, note_text = ? WHERE note_id = ?", [noteHistory.note_title, noteHistory.note_text, noteHistory.note_history_id]);- }-};\ No newline at end of filediff --git a/db/migrations/0032__add_option_for_encrypted_data_key_iv.sql b/db/migrations/0032__add_option_for_encrypted_data_key_iv.sqldeleted file mode 100644index e77d395da6..0000000000--- a/db/migrations/0032__add_option_for_encrypted_data_key_iv.sql+++ /dev/null@@ -1 +0,0 @@-INSERT INTO options (opt_name, opt_value) VALUES ('encrypted_data_key_iv', '')\ No newline at end of filediff --git a/db/migrations/0033__change_data_key_encryption_to_cbc.js b/db/migrations/0033__change_data_key_encryption_to_cbc.jsdeleted file mode 100644index a0117a22ad..0000000000--- a/db/migrations/0033__change_data_key_encryption_to_cbc.js+++ /dev/null@@ -1,25 +0,0 @@-const password_encryption = require('../services/password_encryption');-const readline = require('readline');--const cl = readline.createInterface(process.stdin, process.stdout);--function question(q) {- return new Promise( (res, rej) => {- cl.question( q, answer => {- res(answer);- })- });-}--module.exports = async () => {- const password = await question("Enter password: ");- let dataKey = await password_encryption.getDecryptedDataKey(password);-- console.log("Original data key: ", dataKey);-- dataKey = dataKey.slice(0, 16);-- console.log("Trimmed data key: ", dataKey);-- await password_encryption.setDataKey(password, dataKey);-};\ No newline at end of filediff --git a/db/migrations/0034__source_ids.sql b/db/migrations/0034__source_ids.sqldeleted file mode 100644index c48513564e..0000000000--- a/db/migrations/0034__source_ids.sql+++ /dev/null@@ -1,5 +0,0 @@-CREATE TABLE `source_ids` (- `source_id` TEXT NOT NULL,- `date_created` INTEGER NOT NULL,- PRIMARY KEY(`source_id`)-);\ No newline at end of filediff --git a/db/migrations/0035__root_notes_will_have_note_id_root.sql b/db/migrations/0035__root_notes_will_have_note_id_root.sqldeleted file mode 100644index a6d7bedcd7..0000000000--- a/db/migrations/0035__root_notes_will_have_note_id_root.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE notes_tree SET note_pid = 'root' WHERE note_pid = ''\ No newline at end of filediff --git a/db/migrations/0036__clear_sync_table.sql b/db/migrations/0036__clear_sync_table.sqldeleted file mode 100644index b6849242ec..0000000000--- a/db/migrations/0036__clear_sync_table.sql+++ /dev/null@@ -1 +0,0 @@-DELETE FROM sync;\ No newline at end of filediff --git a/db/migrations/0037__add_note_tree_id.sql b/db/migrations/0037__add_note_tree_id.sqldeleted file mode 100644index 5afc168e55..0000000000--- a/db/migrations/0037__add_note_tree_id.sql+++ /dev/null@@ -1,21 +0,0 @@-CREATE TABLE [notes_tree_mig] (- [note_tree_id] VARCHAR(30) PRIMARY KEY NOT NULL,- [note_id] VARCHAR(30) UNIQUE NOT NULL,- [note_pid] VARCHAR(30) NOT NULL,- [note_pos] INTEGER NOT NULL,- [is_expanded] BOOLEAN NULL ,- date_modified INTEGER NOT NULL DEFAULT 0,- is_deleted INTEGER NOT NULL DEFAULT 0-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, note_pid, note_pos, is_expanded, date_modified, is_deleted)- SELECT 'TT' || SUBSTR(note_id, 3), note_id, note_pid, note_pos, is_expanded, date_modified, is_deleted FROM notes_tree;--UPDATE notes_tree_mig SET note_pid = 'TT' || SUBSTR(note_pid, 3) WHERE note_pid != 'root';--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_id` ON `notes_tree` (- `note_tree_id`-);\ No newline at end of filediff --git a/db/migrations/0038__rename_start_node.sql b/db/migrations/0038__rename_start_node.sqldeleted file mode 100644index 9601974c8c..0000000000--- a/db/migrations/0038__rename_start_node.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE options SET opt_name = 'start_note_tree_id' WHERE opt_name = 'start_node';\ No newline at end of filediff --git a/db/migrations/0039__recent_notes_should_point_to_note_tree_id.sql b/db/migrations/0039__recent_notes_should_point_to_note_tree_id.sqldeleted file mode 100644index 00b5efbd35..0000000000--- a/db/migrations/0039__recent_notes_should_point_to_note_tree_id.sql+++ /dev/null@@ -1,7 +0,0 @@-DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- `note_tree_id` TEXT NOT NULL PRIMARY KEY,- `date_accessed` INTEGER NOT NULL ,- is_deleted INT-);\ No newline at end of filediff --git a/db/migrations/0040__fix_note_pid.sql b/db/migrations/0040__fix_note_pid.sqldeleted file mode 100644index f829e69021..0000000000--- a/db/migrations/0040__fix_note_pid.sql+++ /dev/null@@ -1,6 +0,0 @@-UPDATE- notes_tree-SET- note_pid = (SELECT parent.note_id FROM notes_tree parent WHERE notes_tree.note_pid = parent.note_tree_id)-WHERE- note_pid != 'root'\ No newline at end of filediff --git a/db/migrations/0041__recent_notes_with_note_path.sql b/db/migrations/0041__recent_notes_with_note_path.sqldeleted file mode 100644index c83caa699f..0000000000--- a/db/migrations/0041__recent_notes_with_note_path.sql+++ /dev/null@@ -1,7 +0,0 @@-DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- `note_path` TEXT NOT NULL PRIMARY KEY,- `date_accessed` INTEGER NOT NULL ,- is_deleted INT-);\ No newline at end of filediff --git a/db/migrations/0042__remove_unique_index_on_note_id.sql b/db/migrations/0042__remove_unique_index_on_note_id.sqldeleted file mode 100644index f014a16e6a..0000000000--- a/db/migrations/0042__remove_unique_index_on_note_id.sql+++ /dev/null@@ -1,24 +0,0 @@-CREATE TABLE "notes_tree_mig" (- [note_tree_id] VARCHAR(30) PRIMARY KEY NOT NULL,- [note_id] VARCHAR(30) NOT NULL,- [note_pid] VARCHAR(30) NOT NULL,- [note_pos] INTEGER NOT NULL,- [is_expanded] BOOLEAN NULL ,- date_modified INTEGER NOT NULL DEFAULT 0,- is_deleted INTEGER NOT NULL DEFAULT 0-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, note_pid, note_pos, is_expanded, date_modified, is_deleted)- SELECT note_tree_id, note_id, note_pid, note_pos, is_expanded, date_modified, is_deleted FROM notes_tree;--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_tree_id` ON `notes_tree` (- `note_tree_id`-);--CREATE INDEX `IDX_notes_tree_note_id_note_pid` ON `notes_tree` (- `note_id`,- `note_pid`-);\ No newline at end of filediff --git a/db/migrations/0043__clear_sync_table.sql b/db/migrations/0043__clear_sync_table.sqldeleted file mode 100644index 147560955c..0000000000--- a/db/migrations/0043__clear_sync_table.sql+++ /dev/null@@ -1,3 +0,0 @@-DELETE FROM sync;--UPDATE options SET opt_value = 0 WHERE opt_name IN ('last_synced_push', 'last_synced_pull');\ No newline at end of filediff --git a/db/migrations/0044__drop_audit_log.sql b/db/migrations/0044__drop_audit_log.sqldeleted file mode 100644index cf4d993461..0000000000--- a/db/migrations/0044__drop_audit_log.sql+++ /dev/null@@ -1 +0,0 @@-DROP TABLE audit_log;\ No newline at end of filediff --git a/db/migrations/0045__add_prefix_to_notes_tree.sql b/db/migrations/0045__add_prefix_to_notes_tree.sqldeleted file mode 100644index 3f18763c69..0000000000--- a/db/migrations/0045__add_prefix_to_notes_tree.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes_tree ADD COLUMN `prefix` TEXT\ No newline at end of filediff --git a/db/migrations/0046__drop_links_and_images.sql b/db/migrations/0046__drop_links_and_images.sqldeleted file mode 100644index 6536908d19..0000000000--- a/db/migrations/0046__drop_links_and_images.sql+++ /dev/null@@ -1,2 +0,0 @@-DROP TABLE IF EXISTS links;-DROP TABLE IF EXISTS images;\ No newline at end of filediff --git a/db/migrations/0047__test.sql b/db/migrations/0047__test.sqldeleted file mode 100644index 027b7d63fd..0000000000--- a/db/migrations/0047__test.sql+++ /dev/null@@ -1 +0,0 @@-SELECT 1;\ No newline at end of filediff --git a/db/migrations/0048__add_note_tree_id_to_recent_notes.sql b/db/migrations/0048__add_note_tree_id_to_recent_notes.sqldeleted file mode 100644index 3fbc03066f..0000000000--- a/db/migrations/0048__add_note_tree_id_to_recent_notes.sql+++ /dev/null@@ -1,10 +0,0 @@-DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- 'note_tree_id'TEXT NOT NULL PRIMARY KEY,- `note_path` TEXT NOT NULL,- `date_accessed` INTEGER NOT NULL ,- is_deleted INT-);--DELETE FROM sync WHERE entity_name = 'recent_notes';\ No newline at end of filediff --git a/db/migrations/0049__rename_start_note_tree_id_to_note_path.sql b/db/migrations/0049__rename_start_note_tree_id_to_note_path.sqldeleted file mode 100644index 0ba12b4e9f..0000000000--- a/db/migrations/0049__rename_start_note_tree_id_to_note_path.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE options SET opt_name = 'start_note_path' WHERE opt_name = 'start_note_tree_id';\ No newline at end of filediff --git a/db/migrations/0050__string_dates.sql b/db/migrations/0050__string_dates.sqldeleted file mode 100644index 499c6c3064..0000000000--- a/db/migrations/0050__string_dates.sql+++ /dev/null@@ -1,156 +0,0 @@-DROP TABLE migrations;---- Sync-CREATE TABLE `sync_mig` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `entity_name` TEXT NOT NULL,- `entity_id` TEXT NOT NULL,- `source_id` TEXT NOT NULL,- `sync_date` TEXT NOT NULL);--INSERT INTO sync_mig (id, entity_name, entity_id, source_id, sync_date)- SELECT id, entity_name, entity_id, source_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', sync_date, 'unixepoch') FROM sync;--DROP TABLE sync;-ALTER TABLE sync_mig RENAME TO sync;--CREATE UNIQUE INDEX `IDX_sync_entity_name_id` ON `sync` (- `entity_name`,- `entity_id`-);--CREATE INDEX `IDX_sync_sync_date` ON `sync` (- `sync_date`-);---- Options--UPDATE options SET opt_value = strftime('%Y-%m-%dT%H:%M:%S.000Z', opt_value, 'unixepoch') WHERE opt_name IN ('last_backup_date');-UPDATE options SET date_modified = strftime('%Y-%m-%dT%H:%M:%S.000Z', date_modified, 'unixepoch');---- Event log--CREATE TABLE `event_log_mig` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `note_id` TEXT,- `comment` TEXT,- `date_added` TEXT NOT NULL-);--INSERT INTO event_log_mig (id, note_id, comment, date_added)- SELECT id, note_id, comment, strftime('%Y-%m-%dT%H:%M:%S.000Z', date_added, 'unixepoch') FROM event_log;--DROP TABLE event_log;-ALTER TABLE event_log_mig RENAME TO event_log;--CREATE INDEX `IDX_event_log_date_added` ON `event_log` (- `date_added`-);---- Notes--CREATE TABLE IF NOT EXISTS "notes_mig" (- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT NOT NULL DEFAULT 0,- `is_deleted` INT NOT NULL DEFAULT 0,- `date_created` TEXT NOT NULL,- `date_modified` TEXT NOT NULL,- PRIMARY KEY(`note_id`)-);--INSERT INTO notes_mig (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified)- SELECT note_id, note_title, note_text, is_protected, is_deleted,- strftime('%Y-%m-%dT%H:%M:%S.000Z', date_created, 'unixepoch'),- strftime('%Y-%m-%dT%H:%M:%S.000Z', date_modified, 'unixepoch')- FROM notes;--DROP TABLE notes;-ALTER TABLE notes_mig RENAME TO notes;--CREATE INDEX `IDX_notes_is_deleted` ON `notes` (- `is_deleted`-);---- note history--CREATE TABLE IF NOT EXISTS "notes_history_mig" (- `note_history_id` TEXT NOT NULL PRIMARY KEY,- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT NOT NULL DEFAULT 0,- `date_modified_from` TEXT NOT NULL,- `date_modified_to` TEXT NOT NULL-);--INSERT INTO notes_history_mig (note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to)- SELECT note_history_id, note_id, note_title, note_text, is_protected,- strftime('%Y-%m-%dT%H:%M:%S.000Z', date_modified_from, 'unixepoch'),- strftime('%Y-%m-%dT%H:%M:%S.000Z', date_modified_to, 'unixepoch')- FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;--CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);-CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` (- `date_modified_from`-);-CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` (- `date_modified_to`-);---- Source IDs--DROP TABLE source_ids;--CREATE TABLE `source_ids` (- `source_id` TEXT NOT NULL,- `date_created` TEXT NOT NULL,- PRIMARY KEY(`source_id`)-);---- Recent notes--DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- `note_tree_id` TEXT NOT NULL PRIMARY KEY,- `note_path` TEXT NOT NULL,- `date_accessed` TEXT NOT NULL,- is_deleted INT-);---- Notes tree--CREATE TABLE IF NOT EXISTS "notes_tree_mig" (- `note_tree_id` TEXT NOT NULL,- `note_id` TEXT NOT NULL,- `note_pid` TEXT NOT NULL,- `note_pos` INTEGER NOT NULL,- `prefix` TEXT,- `is_expanded` BOOLEAN,- `is_deleted` INTEGER NOT NULL DEFAULT 0,- `date_modified` TEXT NOT NULL,- PRIMARY KEY(`note_tree_id`)-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, note_pid, note_pos, prefix, is_expanded, is_deleted, date_modified)- SELECT note_tree_id, note_id, note_pid, note_pos, prefix, is_expanded, is_deleted,- strftime('%Y-%m-%dT%H:%M:%S.000Z', date_modified, 'unixepoch')- FROM notes_tree;--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_tree_id` ON `notes_tree` (- `note_tree_id`-);-CREATE INDEX `IDX_notes_tree_note_id_note_pid` ON `notes_tree` (- `note_id`,- `note_pid`-);diff --git a/db/migrations/0051__note_id_index_on_notes_tree.sql b/db/migrations/0051__note_id_index_on_notes_tree.sqldeleted file mode 100644index bc08c5d19e..0000000000--- a/db/migrations/0051__note_id_index_on_notes_tree.sql+++ /dev/null@@ -1,5 +0,0 @@-DROP index IDX_notes_tree_note_tree_id;--CREATE INDEX `IDX_notes_tree_note_id` ON `notes_tree` (- `note_id`-);\ No newline at end of filediff --git a/db/migrations/0052__fill_sync_table.sql b/db/migrations/0052__fill_sync_table.sqldeleted file mode 100644index 86787275e8..0000000000--- a/db/migrations/0052__fill_sync_table.sql+++ /dev/null@@ -1,8 +0,0 @@-INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes', note_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes;--INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes_tree', note_tree_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes_tree;--INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes_history', note_history_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes_history;\ No newline at end of filediff --git a/db/migrations/0053__cleanup_inconsistencies.sql b/db/migrations/0053__cleanup_inconsistencies.sqldeleted file mode 100644index 7bea5ea941..0000000000--- a/db/migrations/0053__cleanup_inconsistencies.sql+++ /dev/null@@ -1,18 +0,0 @@-delete from notes where note_id in ('FfZylYxt','HqzAEsR2fFEZ','KgTQDh67+1Mh','TKMbAYl0AFyQ','W+bGM185c6gw',- 'YXBdhv4dYKMy','aF4/6p1zTpIS','nsLnrrDktl/s','wkhFImoPuxky');--delete from notes_tree where note_tree_id in ('TTy5N2y2S6JP','TTkL3rWDexpp','TTEhtomZekUk','TTvP7zW01zwg','TTuYmMTZyKRt'- ,'TToaClamxbBF','TTKvNCe5X2dj','TTE7jFx5A0zW','TTc79bscyrHX','TTcw8ZyDy2Cc','TTdFzAOWA9hZ','TTUyVLqyIvVg','TTy85NKSBDyO'- ,'TTCyuireAWBv','TTDpVyuzbj1a','TTYznrYvAeIs','TTocvv15VMyu','TTjtxQkBT5vj','TToyyRzbBF0T','TTFt8NE9vSyZ','TTfzFZOuuDqv'- ,'TT2e2oUYcxG6','TToXselUpPAy','TTEM68gGukg0','TTkZxxwtUOzW','TTAZNxBtgmmh','TTK1YErdBE3x','TTzjKiEf54o6','TTPWd5Ou1xET'- ,'TTxQtjf22rTL','TTJAGaI4c89V','TTUQmsxSTdV3','TTGAOf5Lvr6b','TTECSDRN4ZPW','TTZZXLiGNWv4','TTxSLphulRct','TT8vld7x0qWF'- ,'TTuuxXnv2Kpw','TT3RkLZ9AI6t','TTuEbI4Cj3qC','TT4CXXRyWRqm','TTQCuFgnMqxX','TTxnDEMz1bd4','TTMOnqhBesjs','TTHblx55gRHN'- ,'TTMHW8HIGCjR','TTxzg3qqyLjw','TTluvD7yS8Rv','TT88qK2j3ggk','TTF7oHhS5ANF','TTOH275JiUSy','TToIt2dQ5tYH','TTBPgixQgbAq'- ,'TTeN46707CJl','TTDb3GC2y6nN','TTlIXFwpICko','TTE6M9AxLh2U','TTjqhB8zXjD6','TT9NPeLg4FjK','TTj12jDX7TM3','TTPRjf7EdvDX'- ,'TTBnu09pxOmn','TTZxyAkJQ9Cf','TTlvqeof2IBS','TT5R5xtIqRQf','TTiiD6hFjlVH','TTNVjGHSqNgo','TTrORSHCsAVQ','TT5Ei5fngqkv'- ,'TTQ4hdpcIX3C','TTQgxq4CoiHU','TTJayLjI6BSE','TTYyraNy0CVT','TTnAJ3AK3wHz','TTJwKcgs1s0X','TT4FiatgbLEs','TTEdp5Zx1n5F');--update notes_tree set is_deleted = 1 where note_tree_id in ('TTiaU9xqnrca','TTQAy9c1vDId','TTHXWBJB2Y24','TTDV8DUK2IZA'- ,'TTI5JHODZYV5','TTBEZ8TMSJV4','TT1MDWZXE8ZI','TTJV7ZOA8907','TTUGE6N99QSO','TTN0OS17T0KM');--delete from notes_history where note_history_id in ('KHAp5viTrrOfugzQ', 'xmhaS76piZn0QGzn', '25aL96ke8xmud9Bt');\ No newline at end of filediff --git a/db/migrations/0054__more_cleanup_inconsistencies.sql b/db/migrations/0054__more_cleanup_inconsistencies.sqldeleted file mode 100644index 18938c153f..0000000000--- a/db/migrations/0054__more_cleanup_inconsistencies.sql+++ /dev/null@@ -1,3 +0,0 @@-DELETE FROM notes_tree WHERE note_tree_id IN ('cb94QGgnCwOD', 'c3FWKhcVYyaQ');--DELETE FROM notes_history WHERE note_history_id IN ('cdUD6ycs3l9h', 'OW4uh0HLtXaw');diff --git a/db/migrations/0055__set_last_synced_push.sql b/db/migrations/0055__set_last_synced_push.sqldeleted file mode 100644index 6c5ab9c840..0000000000--- a/db/migrations/0055__set_last_synced_push.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE options SET opt_value = (SELECT MAX(id) FROM sync) WHERE opt_name = 'last_synced_push';\ No newline at end of filediff --git a/db/migrations/0056__fill_sync_again.sql b/db/migrations/0056__fill_sync_again.sqldeleted file mode 100644index 7b446c6e41..0000000000--- a/db/migrations/0056__fill_sync_again.sql+++ /dev/null@@ -1,13 +0,0 @@-DELETE FROM recent_notes;-DELETE FROM sync;--INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes', note_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes;--INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes_tree', note_tree_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes_tree;--INSERT OR IGNORE INTO sync (entity_name, entity_id, sync_date, source_id)- SELECT 'notes_history', note_history_id, strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), 'IMPORT' FROM notes_history;--UPDATE options SET opt_value = (SELECT MAX(id) FROM sync) WHERE opt_name IN ('last_synced_push', 'last_synced_pull');\ No newline at end of filediff --git a/db/migrations/0057__add_foreign_keys.sql b/db/migrations/0057__add_foreign_keys.sqldeleted file mode 100644index 96cf9e4ec3..0000000000--- a/db/migrations/0057__add_foreign_keys.sql+++ /dev/null@@ -1,101 +0,0 @@-INSERT INTO notes (note_id, note_title, note_text, date_created, date_modified)- VALUES ('root', 'root', 'root', strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'), strftime('%Y-%m-%dT%H:%M:%S.000Z', 'now'));--CREATE TABLE IF NOT EXISTS "notes_mig" (- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT NOT NULL DEFAULT 0,- `is_deleted` INT NOT NULL DEFAULT 0,- `date_created` TEXT NOT NULL,- `date_modified` TEXT NOT NULL,- PRIMARY KEY(`note_id`)-);--INSERT INTO notes_mig (note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified)- SELECT note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified FROM notes;--DROP TABLE notes;-ALTER TABLE notes_mig RENAME TO notes;--CREATE INDEX `IDX_notes_is_deleted` ON `notes` (- `is_deleted`-);--CREATE TABLE IF NOT EXISTS "notes_tree_mig" (- `note_tree_id` TEXT NOT NULL,- `note_id` TEXT NOT NULL,- `parent_note_id` TEXT NOT NULL,- `note_position` INTEGER NOT NULL,- `prefix` TEXT,- `is_expanded` BOOLEAN,- `is_deleted` INTEGER NOT NULL DEFAULT 0,- `date_modified` TEXT NOT NULL,- FOREIGN KEY(note_id) REFERENCES notes(note_id),- FOREIGN KEY(parent_note_id) REFERENCES notes(note_id),- PRIMARY KEY(`note_tree_id`)-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified)- SELECT note_tree_id, note_id, note_pid, note_pos, prefix, is_expanded, is_deleted, date_modified FROM notes_tree;--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_tree_id` ON `notes_tree` (- `note_tree_id`-);-CREATE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` (- `note_id`,- `parent_note_id`-);-CREATE INDEX `IDX_notes_tree_note_id` ON `notes_tree` (- `note_id`-);--CREATE TABLE IF NOT EXISTS "notes_history_mig" (- `note_history_id` TEXT NOT NULL PRIMARY KEY,- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT NOT NULL DEFAULT 0,- `date_modified_from` TEXT NOT NULL,- `date_modified_to` TEXT NOT NULL,- FOREIGN KEY(note_id) REFERENCES notes(note_id)-);--INSERT INTO notes_history_mig (note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to)- SELECT note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;--CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);-CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` (- `date_modified_from`-);-CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` (- `date_modified_to`-);--DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- `note_tree_id` TEXT NOT NULL PRIMARY KEY,- `note_path` TEXT NOT NULL,- `date_accessed` TEXT NOT NULL,- is_deleted INT,- FOREIGN KEY(note_tree_id) REFERENCES notes_tree(note_tree_id)-);--DROP TABLE event_log;--CREATE TABLE `event_log` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `note_id` TEXT,- `comment` TEXT,- `date_added` TEXT NOT NULL,- FOREIGN KEY(note_id) REFERENCES notes(note_id)-);\ No newline at end of filediff --git a/db/migrations/0058__remove_foreign_key_from_notes_tree.sql b/db/migrations/0058__remove_foreign_key_from_notes_tree.sqldeleted file mode 100644index aac3d68b84..0000000000--- a/db/migrations/0058__remove_foreign_key_from_notes_tree.sql+++ /dev/null@@ -1,29 +0,0 @@-CREATE TABLE IF NOT EXISTS "notes_tree_mig" (- `note_tree_id` TEXT NOT NULL,- `note_id` TEXT NOT NULL,- `parent_note_id` TEXT NOT NULL,- `note_position` INTEGER NOT NULL,- `prefix` TEXT,- `is_expanded` BOOLEAN,- `is_deleted` INTEGER NOT NULL DEFAULT 0,- `date_modified` TEXT NOT NULL,- FOREIGN KEY(note_id) REFERENCES notes(note_id),- PRIMARY KEY(`note_tree_id`)-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified)- SELECT note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified FROM notes_tree;--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_tree_id` ON `notes_tree` (- `note_tree_id`-);-CREATE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` (- `note_id`,- `parent_note_id`-);-CREATE INDEX `IDX_notes_tree_note_id` ON `notes_tree` (- `note_id`-);\ No newline at end of filediff --git a/db/migrations/0059__remove_foreign_key_again.sql b/db/migrations/0059__remove_foreign_key_again.sqldeleted file mode 100644index 22b83eaf76..0000000000--- a/db/migrations/0059__remove_foreign_key_again.sql+++ /dev/null@@ -1,28 +0,0 @@-CREATE TABLE IF NOT EXISTS "notes_tree_mig" (- `note_tree_id` TEXT NOT NULL,- `note_id` TEXT NOT NULL,- `parent_note_id` TEXT NOT NULL,- `note_position` INTEGER NOT NULL,- `prefix` TEXT,- `is_expanded` BOOLEAN,- `is_deleted` INTEGER NOT NULL DEFAULT 0,- `date_modified` TEXT NOT NULL,- PRIMARY KEY(`note_tree_id`)-);--INSERT INTO notes_tree_mig (note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified)- SELECT note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified FROM notes_tree;--DROP TABLE notes_tree;-ALTER TABLE notes_tree_mig RENAME TO notes_tree;--CREATE INDEX `IDX_notes_tree_note_tree_id` ON `notes_tree` (- `note_tree_id`-);-CREATE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` (- `note_id`,- `parent_note_id`-);-CREATE INDEX `IDX_notes_tree_note_id` ON `notes_tree` (- `note_id`-);\ No newline at end of filediff --git a/db/migrations/0060__remove_rest_of_foreign_keys.sql b/db/migrations/0060__remove_rest_of_foreign_keys.sqldeleted file mode 100644index 06db061d78..0000000000--- a/db/migrations/0060__remove_rest_of_foreign_keys.sql+++ /dev/null@@ -1,34 +0,0 @@-CREATE TABLE IF NOT EXISTS "notes_history_mig" (- `note_history_id` TEXT NOT NULL PRIMARY KEY,- `note_id` TEXT NOT NULL,- `note_title` TEXT,- `note_text` TEXT,- `is_protected` INT NOT NULL DEFAULT 0,- `date_modified_from` TEXT NOT NULL,- `date_modified_to` TEXT NOT NULL-);--INSERT INTO notes_history_mig (note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to)- SELECT note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to FROM notes_history;--DROP TABLE notes_history;-ALTER TABLE notes_history_mig RENAME TO notes_history;--CREATE INDEX `IDX_notes_history_note_id` ON `notes_history` (- `note_id`-);-CREATE INDEX `IDX_notes_history_note_date_modified_from` ON `notes_history` (- `date_modified_from`-);-CREATE INDEX `IDX_notes_history_note_date_modified_to` ON `notes_history` (- `date_modified_to`-);--DROP TABLE recent_notes;--CREATE TABLE `recent_notes` (- `note_tree_id` TEXT NOT NULL PRIMARY KEY,- `note_path` TEXT NOT NULL,- `date_accessed` TEXT NOT NULL,- is_deleted INT-);\ No newline at end of filediff --git a/db/migrations/0061__change_index_to_unique.sql b/db/migrations/0061__change_index_to_unique.sqldeleted file mode 100644index 005658567f..0000000000--- a/db/migrations/0061__change_index_to_unique.sql+++ /dev/null@@ -1,6 +0,0 @@-DROP INDEX IDX_notes_tree_note_id_parent_note_id;--CREATE UNIQUE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` (- `note_id`,- `parent_note_id`-);\ No newline at end of filediff --git a/db/migrations/0062__change_index_back_to_non_unique.sql b/db/migrations/0062__change_index_back_to_non_unique.sqldeleted file mode 100644index 33b575b599..0000000000--- a/db/migrations/0062__change_index_back_to_non_unique.sql+++ /dev/null@@ -1,9 +0,0 @@-DROP INDEX IDX_notes_tree_note_id_parent_note_id;--CREATE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` (- `note_id`,- `parent_note_id`-);---- dropping this as it's just duplicate of primary key-DROP INDEX IDX_notes_tree_note_tree_id;\ No newline at end of filediff --git a/db/migrations/0063__image_table.sql b/db/migrations/0063__image_table.sqldeleted file mode 100644index 7a3d6932eb..0000000000--- a/db/migrations/0063__image_table.sql+++ /dev/null@@ -1,11 +0,0 @@-CREATE TABLE images-(- image_id TEXT PRIMARY KEY NOT NULL,- format TEXT NOT NULL,- checksum TEXT NOT NULL,- name TEXT NOT NULL,- data BLOB,- is_deleted INT NOT NULL DEFAULT 0,- date_modified TEXT NOT NULL,- date_created TEXT NOT NULL-);\ No newline at end of filediff --git a/db/migrations/0064__add_note_id_to_image_table.sql b/db/migrations/0064__add_note_id_to_image_table.sqldeleted file mode 100644index eb491fff51..0000000000--- a/db/migrations/0064__add_note_id_to_image_table.sql+++ /dev/null@@ -1,16 +0,0 @@-DROP TABLE images;--CREATE TABLE images-(- image_id TEXT PRIMARY KEY NOT NULL,- note_id TEXT NOT NULL,- format TEXT NOT NULL,- checksum TEXT NOT NULL,- name TEXT NOT NULL,- data BLOB,- is_deleted INT NOT NULL DEFAULT 0,- date_modified TEXT NOT NULL,- date_created TEXT NOT NULL-);--CREATE INDEX images_note_id_index ON images (note_id);\ No newline at end of filediff --git a/db/migrations/0065__notes_image.sql b/db/migrations/0065__notes_image.sqldeleted file mode 100644index 659006fa01..0000000000--- a/db/migrations/0065__notes_image.sql+++ /dev/null@@ -1,27 +0,0 @@-DROP TABLE images;--CREATE TABLE images-(- image_id TEXT PRIMARY KEY NOT NULL,- format TEXT NOT NULL,- checksum TEXT NOT NULL,- name TEXT NOT NULL,- data BLOB,- is_deleted INT NOT NULL DEFAULT 0,- date_modified TEXT NOT NULL,- date_created TEXT NOT NULL-);--CREATE TABLE notes_image-(- note_image_id TEXT PRIMARY KEY NOT NULL,- note_id TEXT NOT NULL,- image_id TEXT NOT NULL,- is_deleted INT NOT NULL DEFAULT 0,- date_modified TEXT NOT NULL,- date_created TEXT NOT NULL-);--CREATE INDEX notes_image_note_id_index ON notes_image (note_id);-CREATE INDEX notes_image_image_id_index ON notes_image (image_id);-CREATE INDEX notes_image_note_id_image_id_index ON notes_image (note_id, image_id);\ No newline at end of filediff --git a/db/migrations/0066__create_attributes_table.sql b/db/migrations/0066__create_attributes_table.sqldeleted file mode 100644index e2b8c89f0a..0000000000--- a/db/migrations/0066__create_attributes_table.sql+++ /dev/null@@ -1,12 +0,0 @@-CREATE TABLE attributes-(- attribute_id TEXT PRIMARY KEY NOT NULL,- note_id TEXT NOT NULL,- name TEXT NOT NULL,- value TEXT,- date_created TEXT NOT NULL,- date_modified TEXT NOT NULL-);--CREATE INDEX attributes_note_id_index ON attributes (note_id);-CREATE UNIQUE INDEX attributes_note_id_name_index ON attributes (note_id, name);\ No newline at end of filediff --git a/db/migrations/0067__add_is_synced_to_options.sql b/db/migrations/0067__add_is_synced_to_options.sqldeleted file mode 100644index fb10f58af2..0000000000--- a/db/migrations/0067__add_is_synced_to_options.sql+++ /dev/null@@ -1,5 +0,0 @@-ALTER TABLE options ADD COLUMN is_synced INTEGER NOT NULL DEFAULT 0;--UPDATE options SET is_synced = 1 WHERE opt_name IN ('username', 'password_verification_hash', 'password_verification_salt',- 'password_derived_key_salt', 'encrypted_data_key', 'encrypted_data_key_iv',- 'protected_session_timeout', 'history_snapshot_time_interval');\ No newline at end of filediff --git a/db/migrations/0068__add_note_type.sql b/db/migrations/0068__add_note_type.sqldeleted file mode 100644index 2104b11dda..0000000000--- a/db/migrations/0068__add_note_type.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes ADD COLUMN type TEXT NOT NULL DEFAULT 'text';\ No newline at end of filediff --git a/db/migrations/0069__add_mime_to_note.sql b/db/migrations/0069__add_mime_to_note.sqldeleted file mode 100644index a57fd7e3dc..0000000000--- a/db/migrations/0069__add_mime_to_note.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE notes ADD COLUMN mime TEXT NOT NULL DEFAULT 'text/html';\ No newline at end of filediff --git a/db/migrations/0070__rename_columns_to_camel_case.sql b/db/migrations/0070__rename_columns_to_camel_case.sqldeleted file mode 100644index d8340bd66a..0000000000--- a/db/migrations/0070__rename_columns_to_camel_case.sql+++ /dev/null@@ -1,207 +0,0 @@-CREATE TABLE "options_mig" (- `name` TEXT NOT NULL PRIMARY KEY,- `value` TEXT,- `dateModified` INT,- isSynced INTEGER NOT NULL DEFAULT 0);--INSERT INTO options_mig (name, value, dateModified, isSynced)- SELECT opt_name, opt_value, date_modified, is_synced FROM options;--DROP TABLE options;-ALTER TABLE options_mig RENAME TO options;--CREATE TABLE "sync_mig" (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `entityName` TEXT NOT NULL,- `entityId` TEXT NOT NULL,- `sourceId` TEXT NOT NULL,- `syncDate` TEXT NOT NULL);--INSERT INTO sync_mig (id, entityName, entityId, sourceId, syncDate)- SELECT id, entity_name, entity_id, source_id, sync_date FROM sync;--DROP TABLE sync;-ALTER TABLE sync_mig RENAME TO sync;--CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (- `entityName`,- `entityId`-);--CREATE INDEX `IDX_sync_syncDate` ON `sync` (- `syncDate`-);--CREATE TABLE `source_ids_mig` (- `sourceId` TEXT NOT NULL,- `dateCreated` TEXT NOT NULL,- PRIMARY KEY(`sourceId`)-);--INSERT INTO source_ids_mig (sourceId, dateCreated)- SELECT source_id, date_created FROM source_ids;--DROP TABLE source_ids;-ALTER TABLE source_ids_mig RENAME TO source_ids;--CREATE TABLE "notes_mig" (- `noteId` TEXT NOT NULL,- `title` TEXT,- `content` TEXT,- `isProtected` INT NOT NULL DEFAULT 0,- `isDeleted` INT NOT NULL DEFAULT 0,- `dateCreated` TEXT NOT NULL,- `dateModified` TEXT NOT NULL,- type TEXT NOT NULL DEFAULT 'text',- mime TEXT NOT NULL DEFAULT 'text/html',- PRIMARY KEY(`noteId`)-);--INSERT INTO notes_mig (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime)- SELECT note_id, note_title, note_text, is_protected, is_deleted, date_created, date_modified, type, mime FROM notes;--DROP TABLE notes;-ALTER TABLE notes_mig RENAME TO notes;--CREATE INDEX `IDX_notes_isDeleted` ON `notes` (- `isDeleted`-);--CREATE TABLE `event_log_mig` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `noteId` TEXT,- `comment` TEXT,- `dateAdded` TEXT NOT NULL,- FOREIGN KEY(noteId) REFERENCES notes(noteId)-);--INSERT INTO event_log_mig (id, noteId, comment, dateAdded)- SELECT id, note_id, comment, date_added FROM event_log;--DROP TABLE event_log;-ALTER TABLE event_log_mig RENAME TO event_log;--CREATE TABLE "note_tree" (- `noteTreeId` TEXT NOT NULL,- `noteId` TEXT NOT NULL,- `parentNoteId` TEXT NOT NULL,- `notePosition` INTEGER NOT NULL,- `prefix` TEXT,- `isExpanded` BOOLEAN,- `isDeleted` INTEGER NOT NULL DEFAULT 0,- `dateModified` TEXT NOT NULL,- PRIMARY KEY(`noteTreeId`)-);--INSERT INTO note_tree (noteTreeId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified)- SELECT note_tree_id, note_id, parent_note_id, note_position, prefix, is_expanded, is_deleted, date_modified FROM notes_tree;--DROP TABLE notes_tree;--CREATE INDEX `IDX_note_tree_noteId` ON `note_tree` (- `noteId`-);--CREATE INDEX `IDX_note_tree_noteId_parentNoteId` ON `note_tree` (- `noteId`,- `parentNoteId`-);--CREATE TABLE "note_revisions" (- `noteRevisionId` TEXT NOT NULL PRIMARY KEY,- `noteId` TEXT NOT NULL,- `title` TEXT,- `content` TEXT,- `isProtected` INT NOT NULL DEFAULT 0,- `dateModifiedFrom` TEXT NOT NULL,- `dateModifiedTo` TEXT NOT NULL-);--INSERT INTO note_revisions (noteRevisionId, noteId, title, content, isProtected, dateModifiedFrom, dateModifiedTo)- SELECT note_history_id, note_id, note_title, note_text, is_protected, date_modified_from, date_modified_to FROM notes_history;--DROP TABLE notes_history;--CREATE INDEX `IDX_note_revisions_noteId` ON `note_revisions` (- `noteId`-);--CREATE INDEX `IDX_note_revisions_dateModifiedFrom` ON `note_revisions` (- `dateModifiedFrom`-);--CREATE INDEX `IDX_note_revisions_dateModifiedTo` ON `note_revisions` (- `dateModifiedTo`-);--CREATE TABLE `recent_notes_mig` (- `noteTreeId` TEXT NOT NULL PRIMARY KEY,- `notePath` TEXT NOT NULL,- `dateAccessed` TEXT NOT NULL,- isDeleted INT-);--INSERT INTO recent_notes_mig (noteTreeId, notePath, dateAccessed, isDeleted)- SELECT note_tree_id, note_path, date_accessed, is_deleted FROM recent_notes;--DROP TABLE recent_notes;-ALTER TABLE recent_notes_mig RENAME TO recent_notes;--CREATE TABLE images_mig-(- imageId TEXT PRIMARY KEY NOT NULL,- format TEXT NOT NULL,- checksum TEXT NOT NULL,- name TEXT NOT NULL,- data BLOB,- isDeleted INT NOT NULL DEFAULT 0,- dateModified TEXT NOT NULL,- dateCreated TEXT NOT NULL-);--INSERT INTO images_mig (imageId, format, checksum, name, data, isDeleted, dateModified, dateCreated)- SELECT image_id, format, checksum, name, data, is_deleted, date_modified, date_created FROM images;--DROP TABLE images;-ALTER TABLE images_mig RENAME TO images;--CREATE TABLE note_images-(- noteImageId TEXT PRIMARY KEY NOT NULL,- noteId TEXT NOT NULL,- imageId TEXT NOT NULL,- isDeleted INT NOT NULL DEFAULT 0,- dateModified TEXT NOT NULL,- dateCreated TEXT NOT NULL-);--INSERT INTO note_images (noteImageId, noteId, imageId, isDeleted, dateModified, dateCreated)- SELECT note_image_id, note_id, image_id, is_deleted, date_modified, date_created FROM notes_image;--DROP TABLE notes_image;--CREATE INDEX IDX_note_images_noteId ON note_images (noteId);--CREATE INDEX IDX_note_images_imageId ON note_images (imageId);--CREATE INDEX IDX_note_images_noteId_imageId ON note_images (noteId, imageId);--CREATE TABLE attributes_mig-(- attributeId TEXT PRIMARY KEY NOT NULL,- noteId TEXT NOT NULL,- name TEXT NOT NULL,- value TEXT,- dateCreated TEXT NOT NULL,- dateModified TEXT NOT NULL-);--INSERT INTO attributes_mig (attributeId, noteId, name, value, dateCreated, dateModified)- SELECT attribute_id, note_id, name, value, date_created, date_modified FROM attributes;--DROP TABLE attributes;-ALTER TABLE attributes_mig RENAME TO attributes;--CREATE INDEX IDX_attributes_noteId ON attributes (noteId);--CREATE UNIQUE INDEX IDX_attributes_noteId_name ON attributes (noteId, name);diff --git a/db/migrations/0071__fix_sync_entity_names.sql b/db/migrations/0071__fix_sync_entity_names.sqldeleted file mode 100644index a165625d78..0000000000--- a/db/migrations/0071__fix_sync_entity_names.sql+++ /dev/null@@ -1,4 +0,0 @@-UPDATE sync SET entityName = 'note_images' WHERE entityName = 'notes_image';-UPDATE sync SET entityName = 'note_tree' WHERE entityName = 'notes_tree';-UPDATE sync SET entityName = 'note_revisions' WHERE entityName = 'notes_history';-UPDATE sync SET entityName = 'note_reordering' WHERE entityName = 'notes_reordering';\ No newline at end of filediff --git a/db/migrations/0072__allow_multiple_attributes_per_note.sql b/db/migrations/0072__allow_multiple_attributes_per_note.sqldeleted file mode 100644index 9023a6ab1a..0000000000--- a/db/migrations/0072__allow_multiple_attributes_per_note.sql+++ /dev/null@@ -1 +0,0 @@-DROP INDEX IDX_attributes_noteId_name;\ No newline at end of filediff --git a/db/migrations/0073__add_isDeleted_to_attributes.sql b/db/migrations/0073__add_isDeleted_to_attributes.sqldeleted file mode 100644index 17951cb1fb..0000000000--- a/db/migrations/0073__add_isDeleted_to_attributes.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE attributes ADD COLUMN isDeleted INT NOT NULL DEFAULT 0;\ No newline at end of filediff --git a/db/migrations/0074__add_position_to_attribute.sql b/db/migrations/0074__add_position_to_attribute.sqldeleted file mode 100644index 350a8aa317..0000000000--- a/db/migrations/0074__add_position_to_attribute.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE attributes ADD COLUMN position INT NOT NULL DEFAULT 0;\ No newline at end of filediff --git a/db/migrations/0075__add_api_token.sql b/db/migrations/0075__add_api_token.sqldeleted file mode 100644index 3dadbc3f47..0000000000--- a/db/migrations/0075__add_api_token.sql+++ /dev/null@@ -1,7 +0,0 @@-CREATE TABLE IF NOT EXISTS "api_tokens"-(- apiTokenId TEXT PRIMARY KEY NOT NULL,- token TEXT NOT NULL,- dateCreated TEXT NOT NULL,- isDeleted INT NOT NULL DEFAULT 0-);\ No newline at end of filediff --git a/db/migrations/0076__add_attribute_name_index.sql b/db/migrations/0076__add_attribute_name_index.sqldeleted file mode 100644index 6911a3f2c6..0000000000--- a/db/migrations/0076__add_attribute_name_index.sql+++ /dev/null@@ -1 +0,0 @@-CREATE INDEX IDX_attributes_name_value ON attributes (name, value);\ No newline at end of filediff --git a/db/migrations/0077__non_null_attribute_value.sql b/db/migrations/0077__non_null_attribute_value.sqldeleted file mode 100644index 8fac721c6e..0000000000--- a/db/migrations/0077__non_null_attribute_value.sql+++ /dev/null@@ -1,23 +0,0 @@-UPDATE attributes SET value = '' WHERE value IS NULL;--CREATE TABLE IF NOT EXISTS "attributes_mig"-(- attributeId TEXT PRIMARY KEY NOT NULL,- noteId TEXT NOT NULL,- name TEXT NOT NULL,- value TEXT NOT NULL DEFAULT '',- position INT NOT NULL DEFAULT 0,- dateCreated TEXT NOT NULL,- dateModified TEXT NOT NULL,- isDeleted INT NOT NULL-);--INSERT INTO attributes_mig (attributeId, noteId, name, value, position, dateCreated, dateModified, isDeleted)- SELECT attributeId, noteId, name, value, position, dateCreated, dateModified, isDeleted FROM attributes;--DROP TABLE attributes;--ALTER TABLE attributes_mig RENAME TO attributes;--CREATE INDEX IDX_attributes_noteId ON attributes (noteId);-CREATE INDEX IDX_attributes_name_value ON attributes (name, value);\ No newline at end of filediff --git a/db/migrations/0078__javascript_type.sql b/db/migrations/0078__javascript_type.sqldeleted file mode 100644index 804a6066c2..0000000000--- a/db/migrations/0078__javascript_type.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE notes SET mime = 'application/javascript;env=frontend' WHERE type = 'code' AND mime = 'application/javascript';\ No newline at end of filediff --git a/db/migrations/0079__rename_note_tree.sql b/db/migrations/0079__rename_note_tree.sqldeleted file mode 100644index 4122567f2e..0000000000--- a/db/migrations/0079__rename_note_tree.sql+++ /dev/null@@ -1,38 +0,0 @@-CREATE TABLE "branches" (- `branchId` TEXT NOT NULL,- `noteId` TEXT NOT NULL,- `parentNoteId` TEXT NOT NULL,- `notePosition` INTEGER NOT NULL,- `prefix` TEXT,- `isExpanded` BOOLEAN,- `isDeleted` INTEGER NOT NULL DEFAULT 0,- `dateModified` TEXT NOT NULL,- PRIMARY KEY(`branchId`)-);--INSERT INTO branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified)- SELECT noteTreeId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, dateModified FROM note_tree;--DROP TABLE note_tree;--CREATE INDEX `IDX_branches_noteId` ON `branches` (- `noteId`-);--CREATE INDEX `IDX_branches_noteId_parentNoteId` ON `branches` (- `noteId`,- `parentNoteId`-);--CREATE TABLE `recent_notes_mig` (- `branchId` TEXT NOT NULL PRIMARY KEY,- `notePath` TEXT NOT NULL,- `dateAccessed` TEXT NOT NULL,- isDeleted INT-);--INSERT INTO recent_notes_mig (branchId, notePath, dateAccessed, isDeleted)- SELECT noteTreeId, notePath, dateAccessed, isDeleted FROM recent_notes;--DROP TABLE recent_notes;-ALTER TABLE recent_notes_mig RENAME TO recent_notes;\ No newline at end of filediff --git a/db/migrations/0080__rename_attributes_to_labels.sql b/db/migrations/0080__rename_attributes_to_labels.sqldeleted file mode 100644index 201922feae..0000000000--- a/db/migrations/0080__rename_attributes_to_labels.sql+++ /dev/null@@ -1,22 +0,0 @@-create table labels-(- labelId TEXT not null primary key,- noteId TEXT not null,- name TEXT not null,- value TEXT default '' not null,- position INT default 0 not null,- dateCreated TEXT not null,- dateModified TEXT not null,- isDeleted INT not null-);--create index IDX_labels_name_value- on labels (name, value);--create index IDX_labels_noteId- on labels (noteId);--INSERT INTO labels (labelId, noteId, name, "value", "position", dateCreated, dateModified, isDeleted)- SELECT attributeId, noteId, name, "value", "position", dateCreated, dateModified, isDeleted FROM attributes;--DROP TABLE attributes;\ No newline at end of filediff --git a/db/migrations/0081__rename_history_snapshot_time_interval.sql b/db/migrations/0081__rename_history_snapshot_time_interval.sqldeleted file mode 100644index 8416ec760f..0000000000--- a/db/migrations/0081__rename_history_snapshot_time_interval.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE options SET name = 'note_revision_snapshot_time_interval' WHERE name = 'history_snapshot_time_interval';\ No newline at end of filediff --git a/db/migrations/0082__camelCase_options.sql b/db/migrations/0082__camelCase_options.sqldeleted file mode 100644index 9dd45d6a1c..0000000000--- a/db/migrations/0082__camelCase_options.sql+++ /dev/null@@ -1,14 +0,0 @@-UPDATE "options" SET "name" = 'passwordVerificationHash' WHERE "name" = 'password_verification_hash';-UPDATE "options" SET "name" = 'dbVersion' WHERE "name" = 'db_version';-UPDATE "options" SET "name" = 'passwordDerivedKeySalt' WHERE "name" = 'password_derived_key_salt';-UPDATE "options" SET "name" = 'documentId' WHERE "name" = 'document_id';-UPDATE "options" SET "name" = 'lastSyncedPull' WHERE "name" = 'last_synced_pull';-UPDATE "options" SET "name" = 'startNotePath' WHERE "name" = 'start_note_path';-UPDATE "options" SET "name" = 'lastSyncedPush' WHERE "name" = 'last_synced_push';-UPDATE "options" SET "name" = 'documentSecret' WHERE "name" = 'document_secret';-UPDATE "options" SET "name" = 'lastBackupDate' WHERE "name" = 'last_backup_date';-UPDATE "options" SET "name" = 'noteRevisionSnapshotTimeInterval' WHERE "name" = 'note_revision_snapshot_time_interval';-UPDATE "options" SET "name" = 'protectedSessionTimeout' WHERE "name" = 'protected_session_timeout';-UPDATE "options" SET "name" = 'encryptedDataKey' WHERE "name" = 'encrypted_data_key';-UPDATE "options" SET "name" = 'encryptedDataKeyIv' WHERE "name" = 'encrypted_data_key_iv';-UPDATE "options" SET "name" = 'passwordVerificationSalt' WHERE "name" = 'password_verification_salt';diff --git a/db/migrations/0083__camelCase_labels.sql b/db/migrations/0083__camelCase_labels.sqldeleted file mode 100644index fa318b6c40..0000000000--- a/db/migrations/0083__camelCase_labels.sql+++ /dev/null@@ -1,7 +0,0 @@-UPDATE labels SET name = 'disableVersioning' WHERE name = 'disable_versioning';-UPDATE labels SET name = 'calendarRoot' WHERE name = 'calendar_root';-UPDATE labels SET name = 'hideInAutocomplete' WHERE name = 'hide_in_autocomplete';-UPDATE labels SET name = 'excludeFromExport' WHERE name = 'exclude_from_export';-UPDATE labels SET name = 'manualTransactionHandling' WHERE name = 'manual_transaction_handling';-UPDATE labels SET name = 'disableInclusion' WHERE name = 'disable_inclusion';-UPDATE labels SET name = 'appCss' WHERE name = 'app_css';\ No newline at end of filediff --git a/db/migrations/0084__camelCase_reddit_ids.sql b/db/migrations/0084__camelCase_reddit_ids.sqldeleted file mode 100644index cb0cc2e710..0000000000--- a/db/migrations/0084__camelCase_reddit_ids.sql+++ /dev/null@@ -1,4 +0,0 @@-UPDATE labels SET name = 'redditId' WHERE name = 'reddit_id';-UPDATE labels SET name = 'redditKind' WHERE name = 'reddit_kind';-UPDATE labels SET name = 'redditCreatedUtc' WHERE name = 'reddit_created_utc';-UPDATE labels SET name = 'redditDateNote' WHERE name = 'reddit_date_note';diff --git a/db/migrations/0085__camelCase_run_values.sql b/db/migrations/0085__camelCase_run_values.sqldeleted file mode 100644index 8754cef5d5..0000000000--- a/db/migrations/0085__camelCase_run_values.sql+++ /dev/null@@ -1,2 +0,0 @@-UPDATE labels SET value = 'frontendStartup' WHERE value = 'frontend_startup';-UPDATE labels SET value = 'backendStartup' WHERE value = 'backend_startup';diff --git a/db/migrations/0086__camelCase_custom_labels.sql b/db/migrations/0086__camelCase_custom_labels.sqldeleted file mode 100644index a94a72e1e5..0000000000--- a/db/migrations/0086__camelCase_custom_labels.sql+++ /dev/null@@ -1,7 +0,0 @@-UPDATE labels SET name = 'dateData' WHERE name = 'date_data';-UPDATE labels SET name = 'dateNote' WHERE name = 'date_note';-UPDATE labels SET name = 'fileSize' WHERE name = 'file_size';-UPDATE labels SET name = 'hideInAutocomplete' WHERE name = 'hide_in_autocomplete';-UPDATE labels SET name = 'monthNote' WHERE name = 'month_note';-UPDATE labels SET name = 'originalFileName' WHERE name = 'original_file_name';-UPDATE labels SET name = 'yearNote' WHERE name = 'year_note';diff --git a/db/migrations/0087__add_type_mime_to_note_revision.sql b/db/migrations/0087__add_type_mime_to_note_revision.sqldeleted file mode 100644index f4b6629e37..0000000000--- a/db/migrations/0087__add_type_mime_to_note_revision.sql+++ /dev/null@@ -1,5 +0,0 @@-ALTER TABLE note_revisions ADD type TEXT DEFAULT '' NOT NULL;-ALTER TABLE note_revisions ADD mime TEXT DEFAULT '' NOT NULL;--UPDATE note_revisions SET type = (SELECT type FROM notes WHERE notes.noteId = note_revisions.noteId);-UPDATE note_revisions SET mime = (SELECT mime FROM notes WHERE notes.noteId = note_revisions.noteId);\ No newline at end of filediff --git a/db/migrations/0088__non_null_note_title_content.sql b/db/migrations/0088__non_null_note_title_content.sqldeleted file mode 100644index 313c2551b1..0000000000--- a/db/migrations/0088__non_null_note_title_content.sql+++ /dev/null@@ -1,34 +0,0 @@-CREATE TABLE event_logc027-(- id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,- noteId TEXT,- comment TEXT,- dateAdded TEXT NOT NULL-);-INSERT INTO event_logc027(id, noteId, comment, dateAdded) SELECT id, noteId, comment, dateAdded FROM event_log;-DROP TABLE event_log;-ALTER TABLE event_logc027 RENAME TO event_log;--CREATE TABLE IF NOT EXISTS "notes_mig" (- `noteId` TEXT NOT NULL,- `title` TEXT NOT NULL DEFAULT "unnamed",- `content` TEXT NOT NULL DEFAULT "",- `isProtected` INT NOT NULL DEFAULT 0,- `isDeleted` INT NOT NULL DEFAULT 0,- `dateCreated` TEXT NOT NULL,- `dateModified` TEXT NOT NULL,- type TEXT NOT NULL DEFAULT 'text',- mime TEXT NOT NULL DEFAULT 'text/html',- PRIMARY KEY(`noteId`)-);--INSERT INTO notes_mig (noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime)- SELECT noteId, title, content, isProtected, isDeleted, dateCreated, dateModified, type, mime FROM notes;--DROP TABLE notes;--ALTER TABLE notes_mig RENAME TO notes;--CREATE INDEX `IDX_notes_isDeleted` ON `notes` (- `isDeleted`-);\ No newline at end of filediff --git a/db/migrations/0089__add_root_branch.sql b/db/migrations/0089__add_root_branch.sqldeleted file mode 100644index 0c88be74a2..0000000000--- a/db/migrations/0089__add_root_branch.sql+++ /dev/null@@ -1,5 +0,0 @@-INSERT INTO branches (branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, dateModified)- VALUES ('root', 'root', 'none', 0, null, 1, '2018-01-01T00:00:00.000Z');--INSERT INTO sync (entityName, entityId, sourceId, syncDate)- VALUES ('branches' ,'root', 'SYNC_FILL', '2018-01-01T00:00:00.000Z');\ No newline at end of filediff --git a/db/migrations/0090__branch_index.sql b/db/migrations/0090__branch_index.sqldeleted file mode 100644index 88d396a740..0000000000--- a/db/migrations/0090__branch_index.sql+++ /dev/null@@ -1 +0,0 @@-CREATE INDEX IDX_branches_parentNoteId ON branches (parentNoteId);\ No newline at end of filediff --git a/db/migrations/0091__drop_isDeleted_index.sql b/db/migrations/0091__drop_isDeleted_index.sqldeleted file mode 100644index 4d547394bf..0000000000--- a/db/migrations/0091__drop_isDeleted_index.sql+++ /dev/null@@ -1,2 +0,0 @@--- index confuses planner and is mostly useless anyway since we're mostly used in non-deleted notes (which are presumably majority)-DROP INDEX IDX_notes_isDeleted;\ No newline at end of filediff --git a/db/migrations/0092__add_type_index.sql b/db/migrations/0092__add_type_index.sqldeleted file mode 100644index 955d35dc67..0000000000--- a/db/migrations/0092__add_type_index.sql+++ /dev/null@@ -1,2 +0,0 @@-create index IDX_notes_type- on notes (type);\ No newline at end of filediff --git a/db/migrations/0093__add_hash_field.sql b/db/migrations/0093__add_hash_field.sqldeleted file mode 100644index 489ff1061b..0000000000--- a/db/migrations/0093__add_hash_field.sql+++ /dev/null@@ -1,9 +0,0 @@-ALTER TABLE notes ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE branches ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE note_revisions ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE recent_notes ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE options ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE note_images ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE images ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE labels ADD hash TEXT DEFAULT "" NOT NULL;-ALTER TABLE api_tokens ADD hash TEXT DEFAULT "" NOT NULL;\ No newline at end of filediff --git a/db/migrations/0094__unify_auditing_fields.sql b/db/migrations/0094__unify_auditing_fields.sqldeleted file mode 100644index 3875280716..0000000000--- a/db/migrations/0094__unify_auditing_fields.sql+++ /dev/null@@ -1,30 +0,0 @@-ALTER TABLE branches ADD dateCreated TEXT NOT NULL DEFAULT '1970-01-01T00:00:00.000Z';--CREATE TABLE `event_log_mig` (- `id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,- `noteId` TEXT,- `comment` TEXT,- `dateCreated` TEXT NOT NULL-);--INSERT INTO event_log_mig (id, noteId, comment, dateCreated)-SELECT id, noteId, comment, dateAdded FROM event_log;--DROP TABLE event_log;-ALTER TABLE event_log_mig RENAME TO event_log;--ALTER TABLE options ADD dateCreated TEXT NOT NULL DEFAULT '1970-01-01T00:00:00.000Z';--CREATE TABLE `recent_notes_mig` (- `branchId` TEXT NOT NULL PRIMARY KEY,- `notePath` TEXT NOT NULL,- hash TEXT DEFAULT "" NOT NULL,- `dateCreated` TEXT NOT NULL,- isDeleted INT-);--INSERT INTO recent_notes_mig (branchId, notePath, hash, dateCreated, isDeleted)-SELECT branchId, notePath, hash, dateAccessed, isDeleted FROM recent_notes;--DROP TABLE recent_notes;-ALTER TABLE recent_notes_mig RENAME TO recent_notes;\ No newline at end of filediff --git a/db/migrations/0095__mime_type_for_render.sql b/db/migrations/0095__mime_type_for_render.sqldeleted file mode 100644index f23e43c120..0000000000--- a/db/migrations/0095__mime_type_for_render.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE notes SET mime = 'text/html' WHERE type = 'render';\ No newline at end of filediff --git a/db/migrations/0096__unify_surrogate_keys.sql b/db/migrations/0096__unify_surrogate_keys.sqldeleted file mode 100644index a7e49ac7ea..0000000000--- a/db/migrations/0096__unify_surrogate_keys.sql+++ /dev/null@@ -1,29 +0,0 @@-CREATE TABLE `event_log_mig` (- `eventId` TEXT NOT NULL PRIMARY KEY,- `noteId` TEXT,- `comment` TEXT,- `dateCreated` TEXT NOT NULL-);--INSERT INTO event_log_mig (eventId, noteId, comment, dateCreated)-SELECT id, noteId, comment, dateCreated FROM event_log;--DROP TABLE event_log;-ALTER TABLE event_log_mig RENAME TO event_log;--create table options_mig-(- optionId TEXT NOT NULL PRIMARY KEY,- name TEXT not null,- value TEXT,- dateModified INT,- isSynced INTEGER default 0 not null,- hash TEXT default "" not null,- dateCreated TEXT default '1970-01-01T00:00:00.000Z' not null-);--INSERT INTO options_mig (optionId, name, value, dateModified, isSynced, hash, dateCreated)- SELECT name || "_key", name, value, dateModified, isSynced, hash, dateCreated FROM options;--DROP TABLE options;-ALTER TABLE options_mig RENAME TO options;\ No newline at end of filediff --git a/db/migrations/0097__add_zoomFactor.sql b/db/migrations/0097__add_zoomFactor.sqldeleted file mode 100644index b371a3dc76..0000000000--- a/db/migrations/0097__add_zoomFactor.sql+++ /dev/null@@ -1,2 +0,0 @@-INSERT INTO options (optionId, name, value, dateCreated, dateModified, isSynced)-VALUES ('zoomFactor_key', 'zoomFactor', '1.0', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);\ No newline at end of filediff --git a/db/migrations/0098__rename_hideInAutocomplete.sql b/db/migrations/0098__rename_hideInAutocomplete.sqldeleted file mode 100644index a656e1f70b..0000000000--- a/db/migrations/0098__rename_hideInAutocomplete.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE labels SET name = 'archived' WHERE name = 'hideInAutocomplete'\ No newline at end of filediff --git a/db/migrations/0099__add_theme_option.sql b/db/migrations/0099__add_theme_option.sqldeleted file mode 100644index e41fc4bcc0..0000000000--- a/db/migrations/0099__add_theme_option.sql+++ /dev/null@@ -1,2 +0,0 @@-INSERT INTO options (optionId, name, value, dateCreated, dateModified, isSynced)-VALUES ('theme_key', 'theme', 'white', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);\ No newline at end of filediff --git a/db/migrations/0100__remove_optionId.sql b/db/migrations/0100__remove_optionId.sqldeleted file mode 100644index cda7146bba..0000000000--- a/db/migrations/0100__remove_optionId.sql+++ /dev/null@@ -1,15 +0,0 @@-create table options_mig-(- name TEXT not null PRIMARY KEY,- value TEXT,- dateModified INT,- isSynced INTEGER default 0 not null,- hash TEXT default "" not null,- dateCreated TEXT default '1970-01-01T00:00:00.000Z' not null-);--INSERT INTO options_mig (name, value, dateModified, isSynced, hash, dateCreated)-SELECT name, value, dateModified, isSynced, hash, dateCreated FROM options;--DROP TABLE options;-ALTER TABLE options_mig RENAME TO options;\ No newline at end of filediff --git a/db/migrations/0101__add_sync_options.sql b/db/migrations/0101__add_sync_options.sqldeleted file mode 100644index 62dc9a5e20..0000000000--- a/db/migrations/0101__add_sync_options.sql+++ /dev/null@@ -1,8 +0,0 @@-INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('syncServerHost', '', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);--INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('syncServerTimeout', '5000', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);--INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('syncProxy', '', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);\ No newline at end of filediff --git a/db/migrations/0102__fix_sync_entityIds.sql b/db/migrations/0102__fix_sync_entityIds.sqldeleted file mode 100644index 15e5653405..0000000000--- a/db/migrations/0102__fix_sync_entityIds.sql+++ /dev/null@@ -1,2 +0,0 @@-DELETE FROM sync WHERE entityName = 'note_tree';-DELETE FROM sync WHERE entityName = 'attributes';diff --git a/db/migrations/0103__add_initialized_option.sql b/db/migrations/0103__add_initialized_option.sqldeleted file mode 100644index 86d0e6768e..0000000000--- a/db/migrations/0103__add_initialized_option.sql+++ /dev/null@@ -1,2 +0,0 @@-INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('initialized', 'true', '2018-06-01T03:35:55.041Z', '2018-06-01T03:35:55.041Z', 0);\ No newline at end of filediff --git a/db/migrations/0104__fill_sync_rows_for_options.js b/db/migrations/0104__fill_sync_rows_for_options.jsdeleted file mode 100644index 4bb893f34e..0000000000--- a/db/migrations/0104__fill_sync_rows_for_options.js+++ /dev/null@@ -1,4 +0,0 @@-const syncTableService = require('../../src/services/entity_changes.js');--// options has not been filled so far which caused problems with clean-slate sync.-module.exports = async () => await syncTableService.fillAllSyncRows();diff --git a/db/migrations/0105__delete_content_from_soft_deleted_notes.sql b/db/migrations/0105__delete_content_from_soft_deleted_notes.sqldeleted file mode 100644index d594841ee3..0000000000--- a/db/migrations/0105__delete_content_from_soft_deleted_notes.sql+++ /dev/null@@ -1,2 +0,0 @@-UPDATE notes SET content = '' WHERE isDeleted = 1;-UPDATE note_revisions SET content = '' WHERE (SELECT isDeleted FROM notes WHERE noteId = note_revisions.noteId) = 1;\ No newline at end of filediff --git a/db/migrations/0106__add_relations_table.sql b/db/migrations/0106__add_relations_table.sqldeleted file mode 100644index 9cc5cb84e9..0000000000--- a/db/migrations/0106__add_relations_table.sql+++ /dev/null@@ -1,15 +0,0 @@-CREATE TABLE relations-(- relationId TEXT not null primary key,- sourceNoteId TEXT not null,- name TEXT not null,- targetNoteId TEXT not null,- position INT default 0 not null,- dateCreated TEXT not null,- dateModified TEXT not null,- isDeleted INT not null- , hash TEXT DEFAULT "" NOT NULL);-CREATE INDEX IDX_relation_sourceNoteId- on relations (sourceNoteId);-CREATE INDEX IDX_relation_targetNoteId- on relations (targetNoteId);\ No newline at end of filediff --git a/db/migrations/0107__add_inheritable_attribute_to_relations.sql b/db/migrations/0107__add_inheritable_attribute_to_relations.sqldeleted file mode 100644index 282c13f122..0000000000--- a/db/migrations/0107__add_inheritable_attribute_to_relations.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE relations ADD isInheritable int DEFAULT 0 NULL;\ No newline at end of filediff --git a/db/migrations/0108__new_backup_options.sql b/db/migrations/0108__new_backup_options.sqldeleted file mode 100644index 4a4cb94d92..0000000000--- a/db/migrations/0108__new_backup_options.sql+++ /dev/null@@ -1,9 +0,0 @@-UPDATE options SET name = 'lastDailyBackupDate' WHERE name = 'lastBackupDate';--INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('lastWeeklyBackupDate', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);--INSERT INTO options (name, value, dateCreated, dateModified, isSynced)-VALUES ('lastMonthlyBackupDate', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);---- these options are not synced so no need to fix sync rows\ No newline at end of filediff --git a/db/migrations/0109__create_attributes.sql b/db/migrations/0109__create_attributes.sqldeleted file mode 100644index 526a446e7f..0000000000--- a/db/migrations/0109__create_attributes.sql+++ /dev/null@@ -1,27 +0,0 @@-create table attributes-(- attributeId TEXT not null primary key,- noteId TEXT not null,- type TEXT not null,- name TEXT not null,- value TEXT default '' not null,- position INT default 0 not null,- dateCreated TEXT not null,- dateModified TEXT not null,- isDeleted INT not null,- hash TEXT default "" not null);--create index IDX_attributes_name_value- on attributes (name, value);--create index IDX_attributes_value- on attributes (value);--create index IDX_attributes_noteId- on attributes (noteId);--INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash)-SELECT labelId, noteId, 'label', name, value, position, dateCreated, dateModified, isDeleted, hash FROM labels;--INSERT INTO attributes (attributeId, noteId, type, name, value, position, dateCreated, dateModified, isDeleted, hash)-SELECT relationId, sourceNoteId, 'relation', name, targetNoteId, position, dateCreated, dateModified, isDeleted, hash FROM relations;diff --git a/db/migrations/0110__add_isInheritable_to_attributes.sql b/db/migrations/0110__add_isInheritable_to_attributes.sqldeleted file mode 100644index 753e47a7fa..0000000000--- a/db/migrations/0110__add_isInheritable_to_attributes.sql+++ /dev/null@@ -1 +0,0 @@-ALTER TABLE attributes ADD isInheritable int DEFAULT 0 NULL;\ No newline at end of filediff --git a/db/migrations/0111__cleanup_labels_and_relations.sql b/db/migrations/0111__cleanup_labels_and_relations.sqldeleted file mode 100644index 795d883933..0000000000--- a/db/migrations/0111__cleanup_labels_and_relations.sql+++ /dev/null@@ -1,4 +0,0 @@-DROP TABLE relations;-DROP TABLE labels;--DELETE FROM sync WHERE entityName = 'relations' OR entityName = 'labels';\ No newline at end of filediff --git a/db/migrations/0112__rename_inheritAttributes.sql b/db/migrations/0112__rename_inheritAttributes.sqldeleted file mode 100644index 5cb85978a1..0000000000--- a/db/migrations/0112__rename_inheritAttributes.sql+++ /dev/null@@ -1 +0,0 @@-UPDATE attributes SET name = 'template' WHERE name = 'inheritAttributes';\ No newline at end of filediff --git a/package-lock.json b/package-lock.jsonindex d39ae942cd..6d74058e02 100644--- a/package-lock.json+++ b/package-lock.json@@ -989,9 +989,9 @@}},"acorn": {- "version": "8.0.5",- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.5.tgz",- "integrity": "sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg=="+ "version": "8.1.0",+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1.0.tgz",+ "integrity": "sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA=="},"acorn-globals": {"version": "6.0.0",@@ -1894,9 +1894,9 @@"dev": true},"caniuse-lite": {- "version": "1.0.30001197",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001197.tgz",- "integrity": "sha512-8aE+sqBqtXz4G8g35Eg/XEaFr2N7rd/VQ6eABGBmNtcB8cN6qNJhMi6oSFy4UWWZgqgL3filHT8Nha4meu3tsw==",+ "version": "1.0.30001199",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001199.tgz",+ "integrity": "sha512-ifbK2eChUCFUwGhlEzIoVwzFt1+iriSjyKKFYNfv6hN34483wyWpLLavYQXhnR036LhkdUYaSDpHg1El++VgHQ==","dev": true},"caseless": {@@ -2886,9 +2886,9 @@}},"electron": {- "version": "12.0.0",- "resolved": "https://registry.npmjs.org/electron/-/electron-12.0.0.tgz",- "integrity": "sha512-p6oxZ4LG82hopPGAsIMOjyoL49fr6cexyFNH0kADA9Yf+mJ72DN7bjvBG+6V7r6QKhwYgsSsW8RpxBeVOUbxVQ==",+ "version": "12.0.1",+ "resolved": "https://registry.npmjs.org/electron/-/electron-12.0.1.tgz",+ "integrity": "sha512-4bTfLSTmuFkMxq3RMyjd8DxuzbxI1Bde879XDrBA4kFWbKhZ3hfXqHXQz3129eCmcLre5odcNsWq7/xzyJilMA==","dev": true,"requires": {"@electron/get": "^1.0.1",@@ -3053,9 +3053,9 @@}},"electron-dl": {- "version": "3.2.0",- "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.2.0.tgz",- "integrity": "sha512-Wz6YZi0fwy/hmdkrtrBwj7W4JlrFd1tY5jvNdLHd0PUTlJFJ6pGi9mPQGtZRdjodkXYpaiD1uio+wh01hqrZNg==",+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.2.1.tgz",+ "integrity": "sha512-k5DFjocJlXbrjshO1zeWe/Gz7HkGwCgnehHPemiyzN2B/LfLlnbIX7sCj5F+huTwZ2l+nQehTI4IR37xvCn6FQ==","requires": {"ext-name": "^5.0.0","pupa": "^2.0.1",@@ -3593,9 +3593,9 @@}},"electron-to-chromium": {- "version": "1.3.682",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.682.tgz",- "integrity": "sha512-zok2y37qR00U14uM6qBz/3iIjWHom2eRfC2S1StA0RslP7x34jX+j4mxv80t8OEOHLJPVG54ZPeaFxEI7gPrwg==",+ "version": "1.3.687",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.687.tgz",+ "integrity": "sha512-IpzksdQNl3wdgkzf7dnA7/v10w0Utf1dF2L+B4+gKrloBrxCut+au+kky3PYvle3RMdSxZP+UiCZtLbcYRxSNQ==","dev": true},"electron-window-state": {@@ -4903,9 +4903,9 @@"dev": true},"is-svg": {- "version": "4.2.1",- "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.2.1.tgz",- "integrity": "sha512-PHx3ANecKsKNl5y5+Jvt53Y4J7MfMpbNZkv384QNiswMKAWIbvcqbPz+sYbFKJI8Xv3be01GSFniPmoaP+Ai5A==",+ "version": "4.2.2",+ "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.2.2.tgz",+ "integrity": "sha512-JlA7Mc7mfWjdxxTkJ094oUK9amGD7gQaj5xA/NCY0vlVvZ1stmj4VX+bRuwOMN93IHRZ2ctpPH/0FO6DqvQ5Rw==","requires": {"html-comment-regex": "^1.1.2"}@@ -5108,9 +5108,9 @@}},"jsdom": {- "version": "16.5.0",- "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.0.tgz",- "integrity": "sha512-QxZH0nmDTnTTVI0YDm4RUlaUPl5dcyn62G5TMDNfMmTW+J1u1v9gCR8WR+WZ6UghAa7nKJjDOFaI00eMMWvJFQ==",+ "version": "16.5.1",+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.5.1.tgz",+ "integrity": "sha512-pF73EOsJgwZekbDHEY5VO/yKXUkab/DuvrQB/ANVizbr6UAHJsDdHXuotZYwkJSGQl1JM+ivXaqY+XBDDL4TiA==","requires": {"abab": "^2.0.5","acorn": "^8.0.5",@@ -6478,9 +6478,9 @@"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="},"pupa": {- "version": "2.0.1",- "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz",- "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==",+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz",+ "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==","requires": {"escape-goat": "^2.0.0"}@@ -8113,9 +8113,9 @@"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="},"webpack": {- "version": "5.24.4",- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.24.4.tgz",- "integrity": "sha512-RXOdxF9hFFFhg47BryCgyFrEyyu7Y/75/uiI2DoUiTMqysK+WczVSTppvkR47oZcmI/DPaXCiCiaXBP8QjkNpA==",+ "version": "5.25.0",+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.25.0.tgz",+ "integrity": "sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw==","dev": true,"requires": {"@types/eslint-scope": "^3.7.0",diff --git a/package.json b/package.jsonindex dc9f22a68f..02f2f9da47 100644--- a/package.json+++ b/package.json@@ -35,7 +35,7 @@"dayjs": "1.10.4","ejs": "3.1.6","electron-debug": "3.2.0",- "electron-dl": "3.2.0",+ "electron-dl": "3.2.1","electron-find": "1.0.6","electron-window-state": "5.0.3","express": "4.17.1",@@ -49,9 +49,9 @@"image-type": "4.1.0","ini": "2.0.0","is-animated": "^2.0.1",- "is-svg": "4.2.1",+ "is-svg": "4.2.2","jimp": "0.16.1",- "jsdom": "16.5.0",+ "jsdom": "16.5.1","mime-types": "2.1.29","multer": "1.4.2","node-abi": "2.21.0",@@ -78,7 +78,7 @@},"devDependencies": {"cross-env": "7.0.3",- "electron": "12.0.0",+ "electron": "12.0.1","electron-builder": "22.10.5","electron-packager": "15.2.0","electron-rebuild": "2.3.5",@@ -87,7 +87,7 @@"jsdoc": "3.6.6","lorem-ipsum": "2.0.3","rcedit": "3.0.0",- "webpack": "5.24.4",+ "webpack": "5.25.0","webpack-cli": "4.5.0"},"optionalDependencies": {