Skip to content

Instantly share code, notes, and snippets.

@esokullu
Created August 24, 2018 09:40
Show Gist options
  • Save esokullu/cbcb8379aa49ea0637049d832e52493e to your computer and use it in GitHub Desktop.
Save esokullu/cbcb8379aa49ea0637049d832e52493e to your computer and use it in GitHub Desktop.
CREATE TABLE `export-requests` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`instance_id` int(11) NOT NULL,
`requester_id` int(11) NOT NULL,
`request_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fulfill_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `instance_id` (`instance_id`),
KEY `requester_id` (`requester_id`),
CONSTRAINT `export-requests_ibfk_1` FOREIGN KEY (`instance_id`) REFERENCES `instances` (`id`),
CONSTRAINT `export-requests_ibfk_2` FOREIGN KEY (`requester_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
@sudo-barun
Copy link

It is better to use snake_case for table name: export_requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment