Create a SQL table with autoincrement id and timestamps

CREATE TABLE `tutorials` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `published` tinyint(1) DEFAULT '1',
  `createdAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) 

Comments

Popular posts from this blog

How to add Diggit, Technorati, Del.icio.us, Stumbleupon, Reddit and pInterest buttons to your Blogger posts

How to create an organizational chart in your webpage using Google Organization Chart Tools

How to remove “Git” from Windows 7 context menu