From 9f1612058ed7c465c95bd2065324db266ccf4022 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/4] Add index at revision table Signed-off-by: yamashush <38120991+yamashush@users.noreply.github.com> Signed-off-by: Ali Bellamine --- 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 280125cbe4e67d98b34601150aa5909fd7557ef8 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Wed, 5 Jun 2024 15:09:21 +0800 Subject: [PATCH 2/4] style: lint fix Signed-off-by: Yukai Huang Signed-off-by: Ali Bellamine --- 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') } -}; +} From 3ed5c4dd396146bfeb56a5ddc6b4e6734033a99a Mon Sep 17 00:00:00 2001 From: Ali Bellamine Date: Thu, 8 Aug 2024 10:42:50 +0200 Subject: [PATCH 3/4] Fix issue with SQlite connection Signed-off-by: Ali Bellamine --- deployments/docker-entrypoint.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/deployments/docker-entrypoint.sh b/deployments/docker-entrypoint.sh index 0016eaf843..9799d5f15e 100755 --- a/deployments/docker-entrypoint.sh +++ b/deployments/docker-entrypoint.sh @@ -7,8 +7,18 @@ if [[ "$#" -gt 0 ]]; then exit $? fi + # check database and redis is ready -pcheck -env CMD_DB_URL +if [[ $CMD_DB_URL != "sqlite"* ]] ; +then + pcheck -env CMD_DB_URL +fi + +# Install sqlite3 if required +if [[ $CMD_DB_URL == "sqlite"* ]] ; +then + npm install sqlite3 +fi # run DB migrate NEED_MIGRATE=${CMD_AUTO_MIGRATE:=true} From 6c105516879ef2c028b99b8f5d8e719665eee418 Mon Sep 17 00:00:00 2001 From: Ali Bellamine Date: Thu, 8 Aug 2024 11:09:13 +0200 Subject: [PATCH 4/4] Reduce npm install log Signed-off-by: Ali Bellamine --- deployments/docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployments/docker-entrypoint.sh b/deployments/docker-entrypoint.sh index 9799d5f15e..eb62255ce3 100755 --- a/deployments/docker-entrypoint.sh +++ b/deployments/docker-entrypoint.sh @@ -17,7 +17,8 @@ fi # Install sqlite3 if required if [[ $CMD_DB_URL == "sqlite"* ]] ; then - npm install sqlite3 + echo "Installing sqlite3 package..." + npm install -s sqlite3 fi # run DB migrate