Created
February 10, 2016 11:06
-
-
Save eiryu/c992e2e8e4a9fc7ef2a2 to your computer and use it in GitHub Desktop.
MySQLのCREATE TABLEの挙動
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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