【问题标题】:Does a db:migrate on Heroku alter the production database?Heroku 上的 db:migrate 会改变生产数据库吗?
【发布时间】:2012-07-02 05:20:23
【问题描述】:

我正在使用 Heroku 上的一个小应用程序,我想知道 heroku run rake db:migrate 是否会影响生产数据库。有什么想法吗?

我尝试了heroku db:pull,但拉动在中途停止了(更不用说它搞砸了我的本地数据库):

Schema:         60% |====================================================================================                                                        | ETA:  00:00:16
Saving session to pull_201207010723.dat..
!!! Caught Server Exception
HTTP CODE: 503
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
      <style type="text/css">
        html, body, iframe { margin: 0; padding: 0; height: 100%; }
        iframe { display: block; width: 100%; border: none; }
      </style>
    <title>Application Error</title></head>
    </head>
    <body>
      <iframe src="//s3.amazonaws.com/heroku_pages/error.html">
        <p>Application Error</p>
      </iframe>
    </body>
    </html>

补充说明: 本地开发数据库是 sqlite3 和生产数据库(Heroku 标准是 postgresql)。默认情况下,devel db 就是这样,我找不到一个很好的教程来转换为 postgresql。

非常感谢!

【问题讨论】:

标签: ruby-on-rails database postgresql heroku sqlite


【解决方案1】:

运行 heroku run rake db:migrate 确实会改变您在 Heroku 上的数据库——因此它会改变您的生产数据库。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-27
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 2011-10-29
    • 2013-08-22
    • 2014-01-25
    相关资源
    最近更新 更多