2014-11-19 00:06:40 +08:00
|
|
|
|
CREATE DATABASE `db_ctl`;
|
|
|
|
|
USE `db_ctl`;
|
|
|
|
|
|
|
|
|
|
/* <20>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݿ<EFBFBD>|<7C><><EFBFBD>ݱ<EFBFBD>|<7C><><EFBFBD><EFBFBD> <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD> */
|
|
|
|
|
CREATE TABLE `tbl_name_type` (
|
|
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD>Ӧ name <20><>ID<49><44>',
|
|
|
|
|
`name` varchar(64) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>|<7C><><EFBFBD>ݱ<EFBFBD>|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮һ',
|
|
|
|
|
`type` tinyint(1) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 0-<2D><><EFBFBD>ݿ⣬1-<2D><><EFBFBD><EFBFBD>2-<2D><><EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`id`) USING BTREE,
|
|
|
|
|
UNIQUE KEY `Index_name_type` (`name`, `type`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<49>ţ<EFBFBD><C5A3><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>洢<EFBFBD><E6B4A2>¼<EFBFBD><C2BC> */
|
|
|
|
|
CREATE TABLE `tbl_idx_host` (
|
|
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ψһ<EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD>',
|
|
|
|
|
`addr` varchar(32) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>IP:PORT <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<D7BD>',
|
|
|
|
|
`count` bigint(20) NOT NULL COMMENT '<EFBFBD>Ѿ<EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD>¼<EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`id`) USING BTREE,
|
|
|
|
|
UNIQUE KEY `Index_addr` (`addr`) USING BTREE
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<49>ţ<EFBFBD><C5A3><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>洢<EFBFBD><E6B4A2>¼<EFBFBD><C2BC> */
|
|
|
|
|
CREATE TABLE `tbl_dat_host` (
|
|
|
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ψһ<EFBFBD><EFBFBD>ʶ<EFBFBD><EFBFBD>',
|
|
|
|
|
`addr` varchar(32) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD>IP:PORT <20><><EFBFBD><EFBFBD><EFBFBD>ӿ<D7BD>',
|
|
|
|
|
`priority` int(10) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>أ<EFBFBD>ֵԽ<EFBFBD>߱<EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD>',
|
|
|
|
|
`count` bigint(20) NOT NULL COMMENT '<EFBFBD>Ѿ<EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD>¼<EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`id`) USING BTREE,
|
|
|
|
|
UNIQUE KEY `Index_addr` (`addr`) USING BTREE
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> */
|
|
|
|
|
CREATE TABLE `tbl_db_host` (
|
|
|
|
|
`id_db` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 0 <20><> id',
|
|
|
|
|
`id_idx_host` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_idx_host <20>е<EFBFBD> id',
|
|
|
|
|
`count` bigint(20) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еļ<EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`id_db`, `id_idx_host`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1>б<EFBFBD> */
|
|
|
|
|
CREATE TABLE `tbl_db_tbl` (
|
|
|
|
|
`id_db` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 0 <20><> id',
|
|
|
|
|
`id_tbl` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD><EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 1 <20><> id',
|
|
|
|
|
`count` bigint(20) NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD>м<EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`db_name`, `tbl_name`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
|
/* <20><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> */
|
|
|
|
|
CREATE TABLE `tbl_tbl_idx` (
|
|
|
|
|
`id_idx` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 2 <20><> id',
|
|
|
|
|
`id_db` int(10) unsigned NOT NULL COMMNET '<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 0 <20><> id',
|
|
|
|
|
`id_tbl` int(10) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD>ID<EFBFBD>ţ<EFBFBD><EFBFBD><EFBFBD>Ӧ tbl_name <20><> type <20><><EFBFBD><EFBFBD>ֵΪ 1 <20><> id',
|
|
|
|
|
`unique` tinyint(1) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>Ψһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
|
|
|
|
|
`type` tinyint(1) unsigned NOT NULL COMMENT '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>0 - <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>1 - <20><><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>2 - 16λ<36><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3 - 32λ<32><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4 - 64λ<34><CEBB><EFBFBD><EFBFBD>',
|
|
|
|
|
PRIMARY KEY(`id_idx`, `id_db`, `id_tbl`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|