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

Gem does not pick up test db config when using DATABASE_URL env var #147

Open
landovsky opened this issue Sep 3, 2018 · 0 comments
Open

Comments

@landovsky
Copy link

I use .env file to pass postgres url into my apps.

Using this approach, I cannot migrate test environment db using standalone-migrations.

When DATABASE_URL is set in environment, gem ignores existing configuration when other env is specified:
rake db:drop db:create db:migrate RAILS_ENV=testing (where testing refers to valid config.yml)
takes whatever is stored in DATABASE_URL and creates the database. It does it in the specified (testing) mode so that dropping the database with rake db:drop produces ActiveRecord::EnvironmentMismatchError.

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