简体   繁体   中英

Location of postgresql database in nitrous.io project

I'm not sure if I'm going mad or if Heroku's dataclips are acting up but I have the following problem.

I've set up a ruby on rails development environment on Nitrous.io and have connected to a database on Heroku. In Nitrous.io I then type psql to access postgresql.

From there I type \\l to list the databases.

Then \\c <name of development database hosted on heroku>

Then \\dt to list the relations, one of which is users

Finally, I input the command SELECT * FROM users; and this returns relevant information on users such as email address, encrypted password etc etc.

However, when I go to Heroku and create a dataclip with the code select * from users to be run against the same database, I'm getting the following warning

Error: Dataclip cannot be created
ERROR:  relation "users" does not exist
LINE 2: select * from users

Am I completely missing something here or is the dataclip throwing an error for no reason? I'm using Devise (for the first time) in my app. Would this have anything to do with it?

Edit

I'm starting to think I've stored the database on Nitrous.io and not in Heroku. I think I may have used autoparts to install postgresql on my nitrous.io vm

I've run the command SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' as a dataclip on Heroku and the users table just isn't there. I then ran it on some other projects I have on Heroku and I can clearly see the tables I've created.

Can anyone confirm my suspicion or know how I can check the location of the database?

Yes I had indeed set the postgresql database up in nitrous.io itself rather than on Heroku. This page explains it: http://blog.nitrous.io/2013/07/02/building-a-rails-4.0-app-on-nitrous-io.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM