Last active
January 30, 2020 09:43
-
-
Save sibysathyanesan/53ee512b0123b82d3db13bfbd1658f68 to your computer and use it in GitHub Desktop.
created_at, updated_at Column in Your MySQL 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
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