简体   繁体   English

Postgresql数据库在nitroous.io项目中的位置

[英]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. 我不确定我是在发疯还是Heroku的数据剪辑在起作用,但是我有以下问题。

I've set up a ruby on rails development environment on Nitrous.io and have connected to a database on Heroku. 我已经在Nitrous.io上建立了Rails开发环境中的ruby,并已连接到Heroku上的数据库。 In Nitrous.io I then type psql to access postgresql. 然后,在Nitrous.io中,键入psql以访问postgresql。

From there I type \\l to list the databases. 从那里,我键入\\l列出数据库。

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

Then \\dt to list the relations, one of which is users 然后\\dt列出关系,其中之一是users

Finally, I input the command SELECT * FROM users; 最后,我输入命令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 但是,当我转到Heroku并使用代码select * from users创建一个数据剪辑以针对同一数据库运行时,出现以下警告

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. 我在我的应用程序中第一次使用Devise。 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. 我开始认为我已将数据库存储在Nitrous.io而不是Heroku中。 I think I may have used autoparts to install postgresql on my nitrous.io vm 我想我可能已经使用autopart在我的nitroous.io vm上安装了postgresql

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. 我已经在HERoku上运行命令SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'作为数据剪辑,并且用户表不存在。 I then ran it on some other projects I have on Heroku and I can clearly see the tables I've created. 然后,我在Heroku上的其他一些项目上运行它,并且可以清楚地看到我创建的表。

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. 是的,我确实已经在nitroous.io本身而不是在Heroku中设置了postgresql数据库。 This page explains it: http://blog.nitrous.io/2013/07/02/building-a-rails-4.0-app-on-nitrous-io.html 此页面对此进行了解释: http : //blog.nitrous.io/2013/07/02/building-a-rails-4.0-app-on-nitrous-io.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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