Skip to content

Instantly share code, notes, and snippets.

@runa
Created April 23, 2013 14:51
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 runa/5444213 to your computer and use it in GitHub Desktop.
Save runa/5444213 to your computer and use it in GitHub Desktop.
DB.create_table :test_ts2 do
  primary_key :id
  timestamp :xtimestamp1
  timestamp :xtimestamp2
end
mysql> show create table test_ts2;
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table    | Create Table                                                                                                                                                                                                                                                                            |
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| test_ts2 | CREATE TABLE `test_ts2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `xtimestamp1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `xtimestamp2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment