From 0701fd74bc71375c92ae900b93f5baec5bf99c62 Mon Sep 17 00:00:00 2001 From: yamashush <38120991+yamashush@users.noreply.github.com> Date: Sun, 14 Jan 2024 21:38:21 +0900 Subject: [PATCH 1/2] Add index at revision table Signed-off-by: yamashush <38120991+yamashush@users.noreply.github.com> --- lib/migrations/20240114120250-revision-add-index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/migrations/20240114120250-revision-add-index.js diff --git a/lib/migrations/20240114120250-revision-add-index.js b/lib/migrations/20240114120250-revision-add-index.js new file mode 100644 index 0000000000..01d94f56ad --- /dev/null +++ b/lib/migrations/20240114120250-revision-add-index.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.addIndex('Revisions', ['noteId'], {}) + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.removeIndex('Revisions', 'noteId') + } +}; From 0287726e1b06dbd77c6e85a99fe1903e74ba706c Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Wed, 5 Jun 2024 15:09:21 +0800 Subject: [PATCH 2/2] style: lint fix Signed-off-by: Yukai Huang --- lib/migrations/20240114120250-revision-add-index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/migrations/20240114120250-revision-add-index.js b/lib/migrations/20240114120250-revision-add-index.js index 01d94f56ad..2260e918f2 100644 --- a/lib/migrations/20240114120250-revision-add-index.js +++ b/lib/migrations/20240114120250-revision-add-index.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' module.exports = { up: (queryInterface, Sequelize) => { @@ -8,4 +8,4 @@ module.exports = { down: (queryInterface, Sequelize) => { return queryInterface.removeIndex('Revisions', 'noteId') } -}; +}