{"id":1438,"date":"2014-10-13T23:15:36","date_gmt":"2014-10-13T14:15:36","guid":{"rendered":"http:\/\/www.prime-architect.co.jp\/myblog\/?p=1438"},"modified":"2014-10-13T23:19:34","modified_gmt":"2014-10-13T14:19:34","slug":"rails%e3%81%aedb%e5%a4%89%e6%9b%b4%e3%82%92%e9%a0%bb%e7%b9%81%e3%81%ab%e8%a1%8c%e3%81%86%e5%a0%b4%e5%90%88%e3%80%81%e4%be%bf%e5%88%a9%e3%81%aagem","status":"publish","type":"post","link":"https:\/\/www.prime-architect.co.jp\/myblog\/ruby-on-rails-1438","title":{"rendered":"Rails\u306eDB\u5909\u66f4\u3092\u983b\u7e41\u306b\u884c\u3046\u5834\u5408\u3001\u4fbf\u5229\u306agem rails-db-resetup"},"content":{"rendered":"<p>\u6700\u8fd1\u3001Ruby on Rails\u306e\u958b\u767a\u306b\u3069\u3063\u3077\u308a\u30cf\u30de\u3063\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u958b\u767a\u6642\u306bDB\u5468\u308a\u306e\u4fbf\u5229\u306agem\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u306e\u958b\u767a\u30b9\u30bf\u30a4\u30eb\u306f\u3001\u8a2d\u8a08\u3068\u958b\u767a\u3092\u660e\u78ba\u306b\u5206\u96e2\u305b\u305a\u3001\u8a2d\u8a08\u3057\u306a\u304c\u3089\u958b\u767a\u3001\u958b\u767a\u3057\u306a\u304c\u3089\u8a2d\u8a08\u3068\u3044\u3046\u611f\u3058\u306e\u30b9\u30bf\u30a4\u30eb\u3067<\/p>\n<p>\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002\u3067\u3067\u3059\u306d\u3001\u305d\u3093\u306a\u611f\u3058\u3067\u3084\u308b\u308f\u3051\u306a\u306e\u3067\u3001\u7279\u306b\u6700\u521d\u306e\u6bb5\u968e\u3067\u306fDB\u5b9a\u7fa9\u304c\u3057\u3087\u3063\u3061\u3085\u3046\u5909\u308f\u3063\u305f\u308a\u3059\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u30ab\u30e9\u30e0\u8ffd\u52a0\u3084\u3001\u30ab\u30e9\u30e0\u306e\u5c5e\u6027\u5909\u66f4\u3001\u306f\u305f\u307e\u305f\u30c6\u30fc\u30d6\u30eb\u81ea\u4f53\u3092\u306a\u304b\u3063\u305f\u30e2\u30ce\u306b\u3059\u308b\u306a\u3069\u3001\u65e5\u5e38\u7684\u306b\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>Rails\u306e\u5834\u5408\u3001DB\u5b9a\u7fa9\u304c\u5909\u66f4\u306b\u306a\u308b\u5834\u5408\u306f\u3001migration\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u3066\u3001\u66f8\u3044\u3066\u3001rake db:migrate\u3092\u5b9f\u884c\u3059\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u3067\u3082\u3063\u3066\u3001\u30de\u30b9\u30bf\u30c7\u30fc\u30bf\u306a\u3069\u306e\u521d\u671f\u30c7\u30fc\u30bf\u306a\u3069\u306f\u3001seed\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u3044\u3066\u304a\u3044\u3066\u3001 rake db:reset\u3092\u5b9f\u884c\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3082\u3064\u3044\u3067\u306b\u5165\u308c\u76f4\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001\u4f55\u5ea6\u3082\u4f55\u5ea6\u3082\u3053\u306e\u4f5c\u696d\u3092\u3084\u308b\u3068\u308f\u308a\u3068\u9762\u5012\u306a\u308f\u3051\u3067\u3059\u3002\u3000rake db:migrate \u3057\u3066rake db:reset \u3057\u3066 rake db:seed\u3057\u3066\u3068\u3002\u3002<\/p>\n<p>\u304c\u3001\u3057\u304b\u3057\u3001\u3053\u308c\u3092\u4e00\u6c17\u306b\u3084\u3063\u3066\u304f\u308c\u308b\u4fbf\u5229\u306agem\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: 14px; line-height: 23.7999992370605px;\">rails-db-resetup\u3068\u3044\u3046gem\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: 14px; line-height: 23.7999992370605px;\"><a href=\"https:\/\/github.com\/fukajun\/rails-db-resetup\">https:\/\/github.com\/fukajun\/rails-db-resetup<\/a><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u5c0e\u5165\u306f\u3068\u3066\u3082\u7c21\u5358\u3067\u3001gem\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u3044\u3066bundle\u3059\u308c\u3070OK<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u3042\u3068\u306f\u3001DB\u5b9a\u7fa9\u3092\u5909\u66f4\u3057\u305f\u3089\u3001rake db:resetup \u3068\u6253\u3066\u3070\u3001<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">rake db:migrate rake db:reset \u00a0rake db:seed\u3092\u5b9f\u884c\u3059\u308b\u306e\u3068\u540c\u7b49\u306e\u3053\u3068\u3092<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u4e00\u6c17\u306b\u3084\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u306a\u304b\u306a\u304b\u4fbf\u5229\u306a\u306e\u3067<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u8208\u5473\u3042\u308b\u65b9\u306f\u662f\u975e\uff01<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u00a0<\/span><\/span><\/p>\n<p><span style=\"color: #4a4a4a; font-family: 'Helvetica Neue', Helvetica, '\u30d2\u30e9\u30ae\u30ce\u89d2\u30b4 ProN W3', 'Hiragino Kaku Gothic ProN', \u30e1\u30a4\u30ea\u30aa, Meiryo, sans-serif; font-size: large;\"><span style=\"line-height: 23px;\">\u00a0<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u3001Ruby on Rails\u306e\u958b\u767a\u306b\u3069\u3063\u3077\u308a\u30cf\u30de\u3063\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u958b\u767a\u6642\u306bDB\u5468\u308a\u306e\u4fbf\u5229\u306agem\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u4eca\u306e\u958b\u767a\u30b9\u30bf\u30a4\u30eb\u306f\u3001\u8a2d\u8a08\u3068\u958b\u767a\u3092\u660e\u78ba\u306b\u5206\u96e2\u305b\u305a\u3001\u8a2d\u8a08\u3057\u306a\u304c\u3089\u958b\u767a\u3001\u958b\u767a\u3057\u306a\u304c\u3089\u8a2d\u8a08\u3068\u3044\u3046\u611f\u3058\u306e\u30b9 &hellip; <a href=\"https:\/\/www.prime-architect.co.jp\/myblog\/ruby-on-rails-1438\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Rails\u306eDB\u5909\u66f4\u3092\u983b\u7e41\u306b\u884c\u3046\u5834\u5408\u3001\u4fbf\u5229\u306agem rails-db-resetup&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[21],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/posts\/1438"}],"collection":[{"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/comments?post=1438"}],"version-history":[{"count":3,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/posts\/1438\/revisions"}],"predecessor-version":[{"id":1442,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/posts\/1438\/revisions\/1442"}],"wp:attachment":[{"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/media?parent=1438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/categories?post=1438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prime-architect.co.jp\/myblog\/wp-json\/wp\/v2\/tags?post=1438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}