TalentBox / sequel-rails

A gem for using Sequel with Rails 5.x, 6.x, 7.x
http://talentbox.github.io/sequel-rails/
MIT License
326 stars 81 forks source link

db:create tries to create development database twice #153

Closed olivierlacan closed 6 years ago

olivierlacan commented 6 years ago

Not sure about this one but the output is easily reproducible at least:

Created database 'example_app_development'
Created database 'example_app_test'
createdb: database creation failed: ERROR:  database "example_app_development" already exists
Could not create database for development.

This has no effect since the first attempt to create the database succeeds but it's still strange. Running this on latest master.

olivierlacan commented 6 years ago

I lied. This was due to require 'rails/all' leftover in config/application.rb instead of:

require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"
require "rails/test_unit/railtie"

I feel like maybe SequelRails should check for ActiveRecord and warn when it's available to prevent dummies like me from shooting themselves in the foot. I'll do it if that's acceptable.