
September 21st, 2012, 10:23 AM
|
 |
Contributing User
|
|
|
|
|
How do you use and exisitng DB with Ruby
Hi,
I seem to be going round in circles trying to understand how I use an existing MS SQL Database with RoR, also how do I set up my applicaiton to use two MS SQL servers in different locations (different IP addresses and DSN's)
I have edited the database.yml following instructions on the web http://www.myclojureadventure.com/2010/10/getting-rails-3-up-on-windows.html , but that only seems to be for a single SQL server / DSN, my app needs to use more than one SQL server, so where do I put that info.. this is what I currently have
Code:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlserver
mode: odbc
dsn: my_dsn
username: my_username
password: my_password
host: server_ip
database: my_dev_database
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlserver
mode: odbc
dsn: my_dsn
username: my_username
password: my_password
host: server_ip
database: my_test_database
production:
adapter: sqlserver
mode: odbc
dsn: my_dsn
username: my_username
password: my_password
host: server_ip
database: my_production_database
Also the instructions then say to run : 'rake db:create' , Do I want to do this? I don't want to create a DB, I want to use an exisiting one
Is this creating the DB in SQL or in the application?
I'm very confused with all this and appreciate your assistance.
Thanks,
1DMF
|