Skip to content

Instantly share code, notes, and snippets.

@spartan
Last active August 20, 2019 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spartan/0c488ac30d02ed822893a6e23bec879d to your computer and use it in GitHub Desktop.
Save spartan/0c488ac30d02ed822893a6e23bec879d to your computer and use it in GitHub Desktop.
MySQL Table suffix columns
alter table {name}
add column `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
add column `created_by` int(10) unsigned NOT NULL,
add column `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
add column `updated_by` int(10) unsigned DEFAULT NULL,
/* add column `deleted_at` timestamp DEFAULT NULL, */
/* add column `deleted_by` int(10) unsigned DEFAULT NULL, */
add column `status` tinyint(3) unsigned NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment