Try
rake db:create:all
And yes, it is possible to have multiple db connections in a Rails application.
This is what I did once, I created two classes that inherit from ActiveRecord::Baseand establish connections inside these classes.
ActiveRecord
:
database.yml file
test1:
adapter: mysql
encoding: utf8
database: test1
username: root
password: xxx
host: localhost
test2:
adapter: mysql
encoding: utf8
database: test2
username: root
password: xxx
host: localhost
test1 test2:
class Test1Base < ActiveRecord::Base
self.abstract_class = true
establish_connection("test1")
end
class Test2Base < ActiveRecord::Base
self.abstract_class = true
establish_connection("test2")
end
:
class School < Test1Base
end
class Student < Test2Base
end