Skip to content

Instantly share code, notes, and snippets.

@AntonioCS
Created November 5, 2020 14:25
Show Gist options
  • Save AntonioCS/abc87a6cc693e71a13abb846fb43330a to your computer and use it in GitHub Desktop.
Save AntonioCS/abc87a6cc693e71a13abb846fb43330a to your computer and use it in GitHub Desktop.
Basic create table
CREATE TABLE `<table_name>` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_deleted` TINYINT(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment