Skip to content

Instantly share code, notes, and snippets.

@eiryu
Created February 10, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiryu/c992e2e8e4a9fc7ef2a2 to your computer and use it in GitHub Desktop.
Save eiryu/c992e2e8e4a9fc7ef2a2 to your computer and use it in GitHub Desktop.
MySQLのCREATE TABLEの挙動
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.27 |
+-----------+
1 row in set (0.00 sec)
mysql> create table a(
-> a timestamp not null comment 'foo',
-> b timestamp not null comment 'bar'
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> desc a;
+-------+-----------+------+-----+---------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+-----+---------------------+-----------------------------+
| a | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| b | timestamp | NO | | 0000-00-00 00:00:00 | |
+-------+-----------+------+-----+---------------------+-----------------------------+
2 rows in set (0.01 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment