Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

I can use CURRENT_TIMESTAMP in only one place in the table. So I can’t have MySQL do what I intended it to do -
maintain two timestamps, one to store the record creation timestamp and another to store record update timestamp. So
I thought I’ll maintain those two timestamps by myself in the app. Give me two simple TIMESTAMP fields:

MySQL automatically set the first timestamp field to DEFAULT to CURRENT_TIMESTAMP and ON UPDATE to CURRENT_TIMESTAMP.
The second timestamp field was set to DEFAULT to 0. That was indeed strange.

I thought I found a bug in MySQL. But no, it turns out it is actually a feature! Actually, it’s a result of a
combination of features:

“With neither DEFAULT
CURRENT_TIMESTAMP nor ON
UPDATE CURRENT_TIMESTAMP, it is the same as specifying both DEFAULT
CURRENT_TIMESTAMP and ON
UPDATE CURRENT_TIMESTAMP.”

“It need not be the first TIMESTAMP column in a table that is automatically initialized or updated to the current timestamp. However, to specify automatic initialization or updating for a different TIMESTAMP column, you must suppress the automatic properties for the first one. Then, for the other TIMESTAMP column, the rules for the DEFAULT and ON
UPDATE clauses are the same as for the first TIMESTAMP column, except that if you omit both clauses, no automatic initialization or updating occurs.”

Infering from the above two points from the MySQL manual, if there are two (or more) TIMESTAMP fileds in a table with
no DEFAULT and ON UPDATE clauses specified, MySQL automatically defaults the first timestamp field to have a DEFAULT
CURRENT_TIMESTAMP and an ON UPDATE CURRENT_TIMESTAMP field and the rest of the timestamp fields to have a DEFAULT 0.

Now coming back to the problem at hand, I need to track the creation and update timestamps of a record. This can be
achieved using another feature:

By default, TIMESTAMP columns are NOT
NULL, cannot contain NULL values, and assigning NULL assigns the current timestamp.

So if I assign a NULL value to a NOT NULL TIMESTAMP field, it uses the current timestamp value instead! And that’ll
be my created_at field. The updated_at TIMESTAMP field can have DEFAULT CURRENT_TIMESTAMP and an ON UPDATE
CURRENT_TIMESTAMP to track the update time. So just to keep it a little more obvious I now use the following CREATE
TABLE:

This seems pretty obvious now that I know it but my Google fu failed me on this one, so I thought I’ll add a note
about it should someone encounterthis issue. I was working with the TableViewController and my app would crash with
this error:

I’m using a StoryBoard and the issue is that I had more than one prototype cell visible in the table view. The error
says that there is more than 1 cell with the same
Identifier:

The solution is to set the number of Prototype Cells to the actual number of different types of cells you have (the
‘type’ being identified by the ‘identifier’). In my case, I just had 1 type of cell and so I set the number of
Prototype Cells to 1.

and I quickly noticed the login area on the top right. It only had an email field and a login button. (I was not
signed into Facebook when I visited the page.) For a brief moment I thought Facebook had finally done away with the
concept of passwords somehow!

So I clicked on the login button and it took to me the standard Facebook login page. Oh well, passwords are here to
stay.

But here’s the question: why would Facebook do this? Why would they place only an email field on that page and not a
password field? Isn’t it an extra step for users to click on the login button and then be directed to another page
to enter their password?

And then I wondered if this was a CSS issue, and looked at the source code:

And I was able to confirm that it wasn’t a CSS issue causing the password field to be hidden. There wasn’t any input
field for a password on that page.

And now I found something else that’s interesting. A class named “html7magic”. What am I to expect?! Is FB out there
using HTML 7 secretely and somehow translating their HTML7 code to HTML5 to work with current browsers?!

I was curious how people casually browsing through the Chrome web store would discover Scribble. And so I opened up the Chrome Web Store and browsed
through the first few tile sets of apps on the home page. I didn’t find Scribble there. Oh well, I told myself, referals from newssites, blogs
and other sites are our primary traffic source I guess.

Then I went to the Utilities section since we had posted Scribble
under the Utilities category and there it was - Scribble featured right on top of the Utilties section with the biggest banner we had
uploaded. There were three apps featured on the top in rotation:

Someone wants to hire a person to build a game similar to Pixza! I wonder why he mentions that we didn’t respond to
his attempts to get in touch with us.

“I need someone to partner with for a small project that
should not take more than 1-2 weeks (it might take longer idk)”

- How about a year and a half in the midst of undergrad college work?

Here’s wishing our dear friend all the best in his endaevor. May be, given the availability of platforms like node.js, socket.io, Pusher and Meteor today, building
Pixza from scratch might not take such a long time. We didn’t have these luxuries when we started working on Pixza.
All we had was this Richard Jones’ article to start out with.