mysql default column

mysql 2014. 2. 19. 14:59

CREATE TABLE `test2` (

  `col1` int(11) DEFAULT NULL,

  `col2` int(11) DEFAULT NULL,

  `ins_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

) ENGINE=InnoDB DEFAULT CHARSET=utf8;


또는 


CREATE TABLE `test2` (

  `col1` int(11) DEFAULT NULL,

  `col2` int(11) DEFAULT NULL,

  `ins_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;