{"id":1557,"date":"2014-11-28T16:10:46","date_gmt":"2014-11-28T16:10:46","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=1557"},"modified":"2022-02-17T07:14:02","modified_gmt":"2022-02-17T07:14:02","slug":"auto-timestamp","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/mysql\/tables\/auto-timestamp","title":{"rendered":"Auto Timestamp"},"content":{"rendered":"<h4>\nTo Auto Timestamp A&nbsp;Row<br \/>\n<\/h4>\n<p>\nSet row type as &quot;timestamp&quot;\n<\/p>\n<p>\nDefault:&nbsp;CURRENT_TIMESTAMP\n<\/p>\n<p>\nOn Update Current_Timestamp: checked if you want the timestamp to update when the row changed, not checked to only timewstamp it on creation.\n<\/p>\n<p>\nThis is an equivalent in code:\n<\/p>\n<pre>\r\n<code>\r\nCREATED timestamp NOT NULL default &#39;0000-00-00 00:00:00&#39;,\r\nUPDATED timestamp NOT NULL default now() on update now(),\r\n<\/code><\/pre>\n<p>\nNote:&nbsp;&nbsp;mySQL&nbsp;limitation is that&nbsp;you cannot have two TIMESTAMP columns with defaults that reference CURRENT_TIMESTAMP.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To Auto Timestamp A&nbsp;Row Set row type as &quot;timestamp&quot; Default:&nbsp;CURRENT_TIMESTAMP On Update Current_Timestamp: checked if you want the timestamp to update when the row changed, not checked to only timewstamp it on creation. This is an equivalent in code: CREATED timestamp NOT NULL default &#39;0000-00-00 00:00:00&#39;, UPDATED timestamp NOT NULL default now() on update now(), [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[],"class_list":["post-1557","post","type-post","status-publish","format-standard","hentry","category-tables"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=1557"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1557\/revisions"}],"predecessor-version":[{"id":1559,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1557\/revisions\/1559"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=1557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=1557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}