{"title":"ActiveRecord\u30a8\u30e9\u30fc","author_url":"https://blog.hatena.ne.jp/meo2/","categories":["Rails","errors"],"blog_title":"","published":"2021-04-01 17:39:28","width":"100%","provider_url":"https://hatena.blog","author_name":"meo2","height":"190","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmeo2.hatenablog.com%2Fentry%2F2021%2F04%2F01%2F173928\" title=\"ActiveRecord\u30a8\u30e9\u30fc - \" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://meo2.hatenablog.com/","image_url":null,"url":"https://meo2.hatenablog.com/entry/2021/04/01/173928","description":"ActiveRecord::StatementInvalidSQLite3::SQLException: no such column: tasks.user_id: error\u6587\u306b\u66f8\u3044\u3066\u3042\u308b\u3068\u304a\u308atasks\u30c6\u30fc\u30d6\u30eb\u306buser_id\u30ab\u30e9\u30e0\u304c\u306a\u3044\u3068\u3044\u3046\u30a8\u30e9\u30fc\u3067\u3042\u308b\u3002 \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e0a\u3067User\u3068Task\u3092\u7d10\u4ed8\u3051\u308b\u969b\u306b\u767a\u751f\u3057\u305f\u3002 \u307e\u305a\u3001\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001 $rails g migration AddUserIdToTasks \u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u305f\u3002 class AddUserIdToTasks < ActiveRecord::M\u2026","type":"rich","version":"1.0"}