diff --git a/db/schema.sql b/db/schema.sql index 8a5de85cc..4d6b029dc 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -70,7 +70,7 @@ CREATE INDEX `IDX_notes_is_deleted` ON `notes` ( 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` ( +CREATE UNIQUE INDEX `IDX_notes_tree_note_id_parent_note_id` ON `notes_tree` ( `note_id`, `parent_note_id` ); diff --git a/migrations/0061__change_index_to_unique.sql b/migrations/0061__change_index_to_unique.sql new file mode 100644 index 000000000..005658567 --- /dev/null +++ b/migrations/0061__change_index_to_unique.sql @@ -0,0 +1,6 @@ +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 file diff --git a/services/app_info.js b/services/app_info.js index 208834ffa..3fbb1ac14 100644 --- a/services/app_info.js +++ b/services/app_info.js @@ -3,7 +3,7 @@ const build = require('./build'); const packageJson = require('../package'); -const APP_DB_VERSION = 60; +const APP_DB_VERSION = 61; module.exports = { app_version: packageJson.version,