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

rails db:migrate only works in development mode #3

Open
kohheepeace opened this issue Aug 29, 2021 · 0 comments
Open

rails db:migrate only works in development mode #3

kohheepeace opened this issue Aug 29, 2021 · 0 comments

Comments

@kohheepeace
Copy link
Contributor

kohheepeace commented Aug 29, 2021

Issue

By default in rails,

commands like rails db:create or rails db:migrate are supposed to work in both devlopment and test environments,

but It doesn't work that way on gitpod.

# this create only development database in gitpod
rails db:create

# we need to set RAILS_ENV=test
rails db:create RAILS_ENV=test

Current Possible Causes

This is supposed to be caused because gitpod sets ENV["DATABASE_URL"].

(*In the local development, ENV["DATABASE_URL"] is nil. This is why both development and test migrates are executed correctly at local).

https://github.com/rails/rails/pull/39027/files

Solutions for this issue

I have not yet found a solution for this. I can't set or unset ENV["DATABASE_URL"] on gitpod.

Discussion about current behavior

I want to run rails db:migrate for both development and test environment, but there seems to be a lot of support for current behavior.

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

No branches or pull requests

1 participant