{"id":1339,"date":"2020-05-18T09:12:07","date_gmt":"2020-05-18T00:12:07","guid":{"rendered":"http:\/\/168.138.214.208\/?p=1339"},"modified":"2020-05-18T09:12:45","modified_gmt":"2020-05-18T00:12:45","slug":"post-1339","status":"publish","type":"post","link":"https:\/\/nobunobu1717.site\/?p=1339","title":{"rendered":"heroku\u4e0a\u306eDB(Postgres)\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u305f\u3044\u6642\u306e\u65b9\u6cd5(Ruby on Rails)"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>heroku\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u305fRails\u30a2\u30d7\u30ea\u304b\u3089DB(Postgres)\u3092\u30af\u30ea\u30a2\u3057\u305f\u3044\u6642\u306b\u82e6\u52b4\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p>\u4e0b\u8a18\u306e\u3088\u3046\u306bheroku\u4e0a\u3067db:reset\u3092\u53e9\u304f\u3068\u30a8\u30e9\u30fc\u3067\u6012\u3089\u308c\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true \" >heroku run rails db:reset\r\n\r\n\/\/ \u7565\r\nActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.\r\nIf you are sure you want to continue, run the same command with the environment variable:\r\n<\/pre>\n<p>production\u74b0\u5883\u306b\u5bfe\u3057\u3066\u8aa4\u3063\u3066reset\u3092\u884c\u306a\u308f\u306a\u3044\u3088\u3046\u306b\u3001\u6562\u3048\u3066\u5f3e\u3044\u3066\u3044\u308b\u3088\u3046\u3060\u304c\u3001\u30c6\u30b9\u30c8\u6642\u306b\u306a\u3069\u306b\u56f0\u308b\u3002<\/p>\n<h2>\u65b9\u6cd5<\/h2>\n<p>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u8fbc\u3080\u3002<\/p>\n<pre class=\"lang:default decode:true \" >heroku pg:reset -a &lt;\u30a2\u30d7\u30ea\u540d&gt;<\/pre>\n<p>\u78ba\u8a8d\u306e\u305f\u3081\u306b\u3001\u30a2\u30d7\u30ea\u540d\u306e\u518d\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u5165\u529b\u3092\u884c\u3046\u3068DB\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u308b\u3002<\/p>\n<p>\u5f8c\u306f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3068\u521d\u671f\u5024\u3092\u683c\u7d0d\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n<pre class=\"lang:default decode:true \" >heroku run rails db:migrate\r\nheroku run rails db:seed<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 heroku\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u305fRails\u30a2\u30d7\u30ea\u304b\u3089DB(Postgres)\u3092\u30af\u30ea\u30a2\u3057\u305f\u3044\u6642\u306b\u82e6\u52b4\u3057\u305f\u306e\u3067\u30e1\u30e2\u3002 \u4e0b\u8a18\u306e\u3088\u3046\u306bheroku\u4e0a\u3067db:reset\u3092\u53e9\u304f\u3068\u30a8\u30e9\u30fc\u3067\u6012\u3089\u308c\u308b\u3002 heroku  &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[33,32],"tags":[],"_links":{"self":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/1339"}],"collection":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1339"}],"version-history":[{"count":2,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/1339\/revisions"}],"predecessor-version":[{"id":1341,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/posts\/1339\/revisions\/1341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=\/wp\/v2\/media\/1319"}],"wp:attachment":[{"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nobunobu1717.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}