Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Cannot run a project if it does not have any DB migration #109

Open
malparty opened this issue Aug 15, 2023 · 1 comment · May be fixed by #114
Open

Fix: Cannot run a project if it does not have any DB migration #109

malparty opened this issue Aug 15, 2023 · 1 comment · May be fixed by #114
Milestone

Comments

@malparty
Copy link
Member

Issue

When scaffolding a new project, the api/v1/health route shoud work, even if we have not added any DB migration yet. Currently, the endpoint return 403 ERR_CONNECTION_REFUSED because the app does not start properly (see log FATA[0000] Failed to migrate database: no migration files found).

Expected

A freshly generated project has the endpoint /api/v1/health that returns the 200 OK status code.

Steps to reproduce

  1. Generate a new project
  2. Do NOT add any DB migration
  3. Run the project and query http://localhost:8080/api/v1/health
@markgravity
Copy link

Should we just print the log instead of throwing a fatal error?

err = goose.Up(sqlDB, "database/migrations", goose.WithAllowMissing())
if err != nil {
   log.Println(err)
}

@carryall carryall added this to the 2.3.0 milestone Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants