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: Startup script does not always perform migrations #2246

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

vincent-pochet
Copy link
Collaborator

Context

This PR is a fix for #1945 (comment)

Description

Lago startup script is relying on the rails db:migrate:primary to perform the migration at startup.

Since in some situation, only one database is configured in the database.yml file, the command is failing with the following error:

Unrecognized command "db:migrate:primary" (Rails::Command::UnrecognizedCommandError)
Did you mean?  db:migrate:up

This PR fixes this by using rails db:migrate instead when only one database is present.

@vincent-pochet vincent-pochet merged commit 98b4dcc into main Jul 5, 2024
6 checks passed
@vincent-pochet vincent-pochet deleted the fix-startup-script branch July 5, 2024 11:56
ancorcruz pushed a commit that referenced this pull request Jul 7, 2024
## Context

This PR is a fix for
#1945 (comment)

## Description

Lago startup script is relying on the `rails db:migrate:primary` to
perform the migration at startup.

Since in some situation, only one database is configured in the
`database.yml` file, the command is failing with the following error:
```
Unrecognized command "db:migrate:primary" (Rails::Command::UnrecognizedCommandError)
Did you mean?  db:migrate:up
```

This PR fixes this by using `rails db:migrate` instead when only one
database is present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants