1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
//USING BTREE make where '=' higher performance //create table CREATE TABLE `table_name` ( `id` bigint(22) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(100) DEFAULT NULL COMMENT 'Name', `phone` int(11) DEFAULT NULL COMMENT 'Phone', `fax` int(11) DEFAULT NULL COMMENT 'Fax', `email` varchar(255) DEFAULT NULL COMMENT 'EMAIL', `status` tinyint(1) NOT NULL COMMENT 'Status', `remark` varchar(255) DEFAULT NULL COMMENT 'Remark', `create_time` int(11) DEFAULT '0' COMMENT 'create time', `update_time` int(11) DEFAULT '0' COMMENT 'update time', `create_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'create date', `update_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'update date', PRIMARY KEY (`id`), UNIQUE KEY `phone` (`phone`), KEY `fax` (`fax`), UNIQUE KEY `fax_phone` (`fax`,`phone`) USING BTREE, CONSTRAINT `phone_ibfk_1` FOREIGN KEY (`column?`) REFERENCES `other_table_name` (`phone`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `email_ibfk_1` FOREIGN KEY (`column?`) REFERENCES `other_table_name` (`email`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `status_ibfk_1` FOREIGN KEY (`column?`) REFERENCES `other_table_name` (`status`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `name_ibfk_3` FOREIGN KEY (`column?`) REFERENCES `other_table_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT; |