Reputation: 627
I have an app that I am migrating to Deis and want to use RDS for my Postgres instance. I have Postgres set up but if i run rake db:create:all
from my local machine, configured to point to RDS, I get:
This task only modifies local databases. <db_name> is on a remote host.
Is there a way to create the DB from an existing migration or the schema.rb file?
Update 1
Here is the database.yml
file. All environments inherit the default
default: &default
adapter: postgresql
encoding: utf8
pool: 5
username: <db user I created>
password: <PW>
host: <my_unique_host>.us-east-1.rds.amazonaws.com
port: 5432
Update 2
For the comment about just creating the DB then running db:migrate
like normal, this is exactly the behavior I am not seeing. If I have the DB active and run rake db:migrate
, the process completes and I am presented a new terminal line. No tables/columns are created.
Am I better off trying to do a local DB dump and restoring it into RDS?
Update 3: Solution I have resolved this and wanted to share my learnings:
rake db:migrate
command from a remote host was not working. This may be possible but I was not able to figure it out.rake db:create
and rake db:migrate
. This ack'd back saying the table was created and I was able to verify in the psql prompt.Hopefully this helps.
Upvotes: 0
Views: 2652
Reputation: 7396
ActiveRecord::Tasks::DatabaseTasks::LOCAL_HOSTS << "192.168.1.1" # Replace with the IP you want to connect from
P.S. Keep in mind, it is a dirty hack which may stop working anytime, since it alters a constant.
Upvotes: 0
Reputation: 627
Update 3: Solution I have resolved this and wanted to share my learnings:
Hopefully this helps.
Upvotes: 2