MySQL Forums
Forum List  »  InnoDB

Re: From production to archive ..
Posted by: Mike Moran
Date: October 30, 2012 10:50AM

Rick James Wrote:
-------------------------------------------------------

> Let's see SHOW CREATE TABLE.
>
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`order_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`order_type_id` int(10) unsigned NOT NULL,
`project_id` int(10) unsigned NOT NULL,
`status_id` int(10) unsigned NOT NULL DEFAULT '110',
`priority` int(10) unsigned NOT NULL DEFAULT '10',
`source_id` int(10) unsigned DEFAULT NULL,
`source_seq` int(10) unsigned DEFAULT NULL,
`print_site_id` int(10) unsigned DEFAULT NULL,
`ship_site_id` int(10) unsigned DEFAULT NULL,
`order_note` tinytext,
`date_received` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_due` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_status` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_done` datetime DEFAULT NULL,
PRIMARY KEY (`order_id`),
KEY `order_status_fk` (`status_id`),
KEY `order_type_fk` (`order_type_id`),
KEY `order_project_fk` (`project_id`),
KEY `order_source_fk` (`source_id`),
KEY `orders_print_fk` (`print_site_id`),
KEY `orders_ship_fk` (`ship_site_id`),
KEY `order_proj_status_idx` (`project_id`,`status_id`),
KEY `order_date_done_idx` (`date_done`),
KEY `order_date_status_idx` (`date_status`),
KEY `order_psd_idx` (`project_id`,`status_id`,`date_done`),
KEY `order_pstd_idx` (`order_type_id`,`project_id`,`status_id`,`date_done`),
KEY `order_done_project_type_status_idx` (`date_done`,`project_id`,`order_type_id`,`status_id`),
KEY `orders_status_priority_idx` (`status_id`,`priority`),
CONSTRAINT `orders_print_fk` FOREIGN KEY (`print_site_id`) REFERENCES `type_sites` (`site_id`),
CONSTRAINT `orders_ship_fk` FOREIGN KEY (`ship_site_id`) REFERENCES `type_sites` (`site_id`),
CONSTRAINT `order_project_fk` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`),
CONSTRAINT `order_source_fk` FOREIGN KEY (`source_id`) REFERENCES `sources` (`source_id`),
CONSTRAINT `order_status_fk` FOREIGN KEY (`status_id`) REFERENCES `type_order_statuses` (`status_id`),
CONSTRAINT `order_type_fk` FOREIGN KEY (`order_type_id`) REFERENCES `type_order_types` (`order_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14150912 DEFAULT CHARSET=latin1;

Options: ReplyQuote


Subject
Views
Written By
Posted
1707
September 28, 2012 09:42AM
874
October 01, 2012 07:22PM
692
October 04, 2012 08:24AM
744
October 07, 2012 04:54PM
852
October 30, 2012 09:48AM
Re: From production to archive ..
789
October 30, 2012 10:50AM
823
October 30, 2012 12:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.