Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You will probably need to use a combination of the <code>Datetime</code> datatype and the <code>Timestamp</code> data type. I would set my <code>created</code> column as a <code>DateTime</code> with a <code>DEFAULT NOW()</code>, and my <code>updated</code> column as a <code>Timestamp</code> with <code>DEFAULT CURRENT_TIMESTAMP</code> and an <code>ON UPDATE CURRENT_TIMESTAMP</code> attribute. </p> <p>Here are the docs for the <code>Timestamp</code> dt:</p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/timestamp.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/timestamp.html</a></p> <blockquote> <p>In a CREATE TABLE statement, the first TIMESTAMP column can be declared in any of the following ways:</p> <p>With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.</p> <p>With neither DEFAULT nor ON UPDATE clauses, it is the same as DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP.</p> <p>With a DEFAULT CURRENT_TIMESTAMP clause and no ON UPDATE clause, the column has the current timestamp for its default value but is not automatically updated.</p> <p>With no DEFAULT clause and with an ON UPDATE CURRENT_TIMESTAMP clause, the column has a default of 0 and is automatically updated.</p> <p>With a constant DEFAULT value, the column has the given default and is not automatically initialized to the current timestamp. If the column also has an ON UPDATE CURRENT_TIMESTAMP clause, it is automatically updated; otherwise, it has a constant default and is not automatically updated.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload