错误:关系“地点”不存在Heroku数据库导入 [英] ERROR: relation "places" does not exist Heroku db import

查看:93
本文介绍了错误:关系“地点”不存在Heroku数据库导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这种错误发生在查询postgres时引号或区分大小写错误。其实我有一个.sql文件,我试图导入我的heroku数据库通过命令行,但不断有这个错误。我的.sql文件包含这些查询

  INSERT INTOplaces(Name,Address)VALUES 
('Cookshop Restaurant& amp','Bar'),
('Cafeteria纽约10011),
('Franchia Vegan Cafe','12 Park Ave,New York,NY 10016');


解决方案

问题是,heroku没有迁移你本地有,为了有相同的数据库版本做以下迁移在heroku上:



知道本地db版本做: $ rake db:version



然后取得您在本地获得的版本,并确保您在heroku中使用以下版本:



$ heroku run rake --trace db:migrate VERSION = 20151127134901



说明:基本上,上述命令将数据库迁移到与本地迁移版本相同的heroku。



希望它有帮助! / p>

I know this kind of error happens when having quotes or case sensitivity error in the query of postgres . Actually i'm having a .sql file which i'm trying to import in my heroku db through command line but constantly having this error .My .sql file contains these queries

INSERT INTO "places" ("Name", "Address") VALUES
('Cookshop Restaurant &amp', ' Bar'),
('Cafeteria', '119 7th Ave, New York, NY 10011'),
('Franchia Vegan Cafe', '12 Park Ave, New York, NY 10016');

解决方案

The problem is heroku doesn't have the migrations that you locally have, in order to have the same db version do the following migration on heroku:

To know the local db version do: $ rake db:version

Then take the version you get locally and make sure you have it in heroku by doing the following:

$ heroku run rake --trace db:migrate VERSION=20151127134901

Explanation: Essentially the above command takes the db migration to heroku with the same version of migration you have locally.

Hope it helps!

这篇关于错误:关系“地点”不存在Heroku数据库导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆