【问题标题】:Warning: Data in the database will be overwritten and will not be recoverable警告:数据库中的数据将被覆盖且无法恢复
【发布时间】:2014-07-30 11:39:58
【问题描述】:

我想在 Heroku 上的 ROR 上卸载我的应用程序。我在 Heroku 上卸载了我的应用程序,但我没有数据库。我应该怎么做才能在 Heroku 上卸载我的数据库。我收到了很多错误。 brlow 介绍了此错误之一。现在我的网站可以工作了,但我没有数据库。我读了 Heroku Dev... 很抱歉,我无法卸载数据库。什么错误?你能帮助我吗?请说我应该完成的命令,我的数据库在 Heroku 上运行。

我的网站:http://priroda-site.tk/

我的错误:

    ark@ark-Aspire-5750G:~/appq$ heroku db:pull
Loaded Taps v0.3.24
Auto-detected local database: postgres://postgres:ippolit@localhost/Mirp?encoding=utf8
Warning: Data in the database 'postgres://postgres:ippolit@localhost/Mirp?encoding=utf8' will be overwritten and will not be recoverable.

 !    WARNING: Destructive Action
 !    This command will affect the app: mighty-oasis-6099
 !    To proceed, type "mighty-oasis-6099" or re-run this command with --confirm mighty-oasis-6099

database.yml

    development:
      adapter: postgresql
      database: Mirp
      host: localhost
      username: postgres
      password: ippolit
      encoding: utf8


    # 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: sqlite3
      database: db/test.sqlite3
      pool: 5
      timeout: 5000

production:
  adapter: postgresql
  database: production_db
  pool: 5
  timeout: 5000

【问题讨论】:

    标签: ruby-on-rails database postgresql heroku


    【解决方案1】:

    首先,您应该使用heroku pg:pull 而不是heroku db:pull,后者已被弃用。

    您在下载(提取)数据库时收到的错误是因为您在本地 postgres 实例中已经有一个具有该名称的现有数据库。您可以通过键入 mighty-oasis-6099 来覆盖该数据库的内容,或者将内容拉入本地开发人员的新数据库中:

    heroku pg:pull Mirp_new --app mighty-oasis-6099

    更多选项请参见https://devcenter.heroku.com/articles/heroku-postgresql#pg-push-and-pg-pull

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-17
      • 2017-09-26
      • 1970-01-01
      • 2019-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多