Skip to content

Instantly share code, notes, and snippets.

@sibysathyanesan
Last active January 30, 2020 09:43
Show Gist options
  • Save sibysathyanesan/53ee512b0123b82d3db13bfbd1658f68 to your computer and use it in GitHub Desktop.
Save sibysathyanesan/53ee512b0123b82d3db13bfbd1658f68 to your computer and use it in GitHub Desktop.
created_at, updated_at Column in Your MySQL Table
CREATE TABLE orders(
id INT NOT NULL AUTO_INCREMENT,
user_id INT NULL,
amount FLOAT NULL,
updated_at TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE NOW(),
created_at TIMESTAMP NOT NULL,
PRIMARY KEY(id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment