diff --git a/deployments/docker-entrypoint.sh b/deployments/docker-entrypoint.sh index 0016eaf843..eb62255ce3 100755 --- a/deployments/docker-entrypoint.sh +++ b/deployments/docker-entrypoint.sh @@ -7,8 +7,19 @@ 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 + echo "Installing sqlite3 package..." + npm install -s sqlite3 +fi # run DB migrate NEED_MIGRATE=${CMD_AUTO_MIGRATE:=true} diff --git a/lib/migrations/20240114120250-revision-add-index.js b/lib/migrations/20240114120250-revision-add-index.js new file mode 100644 index 0000000000..2260e918f2 --- /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') + } +}