mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[PR #3550] [CLOSED] feat: run database migration on backend start up #4429
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4429
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/3550
Author: @mirarifhasan
Created: 11/14/2023
Status: ❌ Closed
Base:
release/2023.12.0← Head:feat/migrate-on-startup📝 Commits (1)
fe1d700feat: script command added in package.json📊 Changes
4 files changed (+7 additions, -4 deletions)
View changed files
📝
aio_run.mjs(+1 -1)📝
packages/hoppscotch-backend/Dockerfile(+2 -2)📝
packages/hoppscotch-backend/package.json(+3 -0)📝
prod.Dockerfile(+1 -1)📄 Description
Closes HBE-313
Description
Previously we needed to run
pnpx prisma migrate dev --name somethingto run database migration after container starts.The drawback is, to run the migration command, the backend container must be in running state.
This brings an issue that, if any
onModuleInitneeds to read from database, and database has not migrated earlier, thenonModuleInitfails as well as backend container fails to start. Since backend container fails to start, you can not runpnpx prisma migrate ....command bydocker exec ....In this PR, we introduce a script in the backend
package.jsonto run migration before the backend container startup.This way, you do not need to run
pnpx prisma migrate ...anymore. During the container startup, migration will be executed itself.Checks
Additional Information
Nil
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.