{"id":627,"date":"2023-02-26T11:12:20","date_gmt":"2023-02-26T03:12:20","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=627"},"modified":"2023-04-29T20:16:12","modified_gmt":"2023-04-29T12:16:12","slug":"laravel-error-unknown-column-updated-at-in-field-list","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/laravel-error-unknown-column-updated-at-in-field-list\/","title":{"rendered":"Laravel\u62a5\u9519Unknown column &#8216;updated_at&#8217; in &#8216;field list&#8217;"},"content":{"rendered":"<p><strong>\u95ee\u9898\u63cf\u8ff0<\/strong><\/p>\n<pre><code>Column not found: 1054 Unknown column &#039;updated_at&#039; in &#039;field list&#039;<\/code><\/pre>\n<p><!-- more --><\/p>\n<p><strong>\u5bfc\u81f4\u539f\u56e0<\/strong><\/p>\n<p>Laravel\u7684Eloquent ORM\u95ee\u9898\uff0c\u5f53\u7ee7\u627fEloquent\u7c7b\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u662f\uff1a\u521b\u5efa\u7684\u7c7b\u540d\u7684\u590d\u6570\u5f62\u5f0f\u662f\u4e00\u4e2a\u771f\u5b9e\u8868\u540d\uff0c\u5728\u8fd9\u4e2a\u8868\u4e2d\u8fd8\u6709 <code>updated_at<\/code>, <code>created_at<\/code>, <code>ID<\/code> \u8fd9\u4e09\u4e2a\u5b57\u6bb5\u3002\u800c\u81ea\u5df1\u5efa\u7684\u8868\u91cc\u6ca1\u6709 <code>updated_at<\/code> \u548c <code>created_at<\/code> \u8fd9\u4e24\u4e2a\u5b57\u6bb5\u3002<\/p>\n<p><strong>\u89e3\u51b3\u529e\u6cd5<\/strong><\/p>\n<p>\u91cd\u65b0\u5b9a\u4e49\u5c5e\u6027\u53bb\u8986\u76d6\u7236\u7c7b\u7684\u5c5e\u6027<\/p>\n<pre><code class=\"language-php\">class MyClass extends Eloquent {\n    public $timestamps = false;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 Column not found: 1054 Unknown column &#039;update [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-627","post","type-post","status-publish","format-standard","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=627"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/627\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}