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

Ensure semester and settings models initializer should not run on setup #331

Open
kwfk opened this issue Dec 20, 2019 · 0 comments
Open
Labels

Comments

@kwfk
Copy link
Member

kwfk commented Dec 20, 2019

ensure_semester_and_settings_present initializer should not run on setup.
This breaks rake db:setup and even rake db:create because rails runs all initializer and this initializer causes a db does not exist error before database can be created.
Currently able to be resolved by commenting out the initializer then uncommenting it after running rake db:setup

After running rake db:setup without uncommenting:

rake aborted!
ActiveRecord::NoDatabaseError: FATAL:  database "bp_site_development" does not exist
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:29:in `should_create?'
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:7:in `execute'
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:34:in `<top (required)>'
/home/freddy_kim8/calblueprint.org/config/environment.rb:5:in `<top (required)>'

Caused by:
PG::ConnectionBad: FATAL:  database "bp_site_development" does not exist
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:29:in `should_create?'
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:7:in `execute'
/home/freddy_kim8/calblueprint.org/config/initializers/ensure_semester_and_settings_present.rb:34:in `<top (required)>'
/home/freddy_kim8/calblueprint.org/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:setup => db:schema:load_if_ruby => db:create => db:load_config => environment
(See full trace by running task with --trace)
@kwfk kwfk added the bug label Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant