Last active
September 21, 2022 20:16
-
-
Save T99/8adc92306c7f9c8b830980861ab45743 to your computer and use it in GitHub Desktop.
DDL for a very basic SQL 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 ExampleTable ( | |
`id` INT UNSIGNED NOT NULL | |
AUTO_INCREMENT | |
PRIMARY KEY | |
COMMENT 'An unsigned integer value that uniquely identifies this row among those in this table.', | |
`uuid` CHAR(36) NOT NULL | |
DEFAULT UUID() | |
COMMENT 'A UUID (''universally unique identifier'') that can uniquely identify this row in any context.', | |
`modifiedAt` DATETIME NOT NULL | |
DEFAULT CURRENT_TIMESTAMP | |
ON UPDATE CURRENT_TIMESTAMP | |
COMMENT 'A datetime representing the moment at which this row was most recently modified.', | |
`createdAt` DATETIME NOT NULL | |
DEFAULT CURRENT_TIMESTAMP | |
COMMENT 'A datetime representing the moment at which this row was initially created.', | |
CONSTRAINT `uuid_uindex` | |
UNIQUE (`uuid`) | |
) COMMENT 'A description of this table.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment