diff --git a/control b/control index b7697019..0b56d6cb 100755 --- a/control +++ b/control @@ -1,7 +1,7 @@ #!/bin/bash # release version -version=3.3.1 +version=3.4.0 CWD=$(cd $(dirname $0)/; pwd) cd $CWD diff --git a/sql/README.md b/sql/README.md index 1aed59d0..ffef786f 100644 --- a/sql/README.md +++ b/sql/README.md @@ -10,7 +10,7 @@ module=rdb version=v3.3.3 cat n9e_${module}-patch.sql > upgrade/n9e_${module}-${version}.sql -echo > n9e_{module}-patch.sql +echo > n9e_${module}-patch.sql # 然后提交更改后,再打上版本的tag git add . diff --git a/sql/n9e_mon-patch.sql b/sql/n9e_mon-patch.sql index c10db7c2..8b137891 100644 --- a/sql/n9e_mon-patch.sql +++ b/sql/n9e_mon-patch.sql @@ -1,25 +1 @@ -set names utf8; -use n9e_mon; - -CREATE TABLE `collect_rule` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `nid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'nid', - `step` int(11) NOT NULL DEFAULT '0' COMMENT 'step', - `timeout` int(11) NOT NULL DEFAULT '0' COMMENT 'total timeout', - `collect_type` varchar(64) NOT NULL DEFAULT '' COMMENT 'collector name', - `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name', - `region` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'region', - `comment` varchar(512) NOT NULL DEFAULT '' COMMENT 'comment', - `data` blob NULL COMMENT 'data', - `tags` varchar(512) NOT NULL DEFAULT '' COMMENT 'tags', - `creator` varchar(64) NOT NULL DEFAULT '' COMMENT 'creator', - `last_updator` varchar(64) NOT NULL DEFAULT '' COMMENT 'last_updator', - `created` datetime NOT NULL COMMENT 'created', - `last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - KEY `idx_nid` (`nid`), - KEY `idx_collect_type` (`collect_type`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'api collect'; - - diff --git a/sql/n9e_rdb-patch.sql b/sql/n9e_rdb-patch.sql index 34ac2577..8b137891 100644 --- a/sql/n9e_rdb-patch.sql +++ b/sql/n9e_rdb-patch.sql @@ -1,42 +1 @@ -set names utf8; -use n9e_rdb; -CREATE TABLE `white_list` ( - `id` bigint unsigned not null AUTO_INCREMENT, - `start_ip` varchar(32) DEFAULT '0' NOT NULL, - `end_ip` varchar(32) DEFAULT '0' NOT NULL, - `start_ip_int` bigint DEFAULT '0' NOT NULL, - `end_ip_int` bigint DEFAULT '0' NOT NULL, - `start_time` bigint DEFAULT '0' NOT NULL, - `end_time` bigint DEFAULT '0' NOT NULL, - `created_at` bigint DEFAULT '0' NOT NULL, - `updated_at` bigint DEFAULT '0' NOT NULL, - `creator` varchar(64) DEFAULT '' NOT NULL, - `updater` varchar(64) DEFAULT '' NOT NULL, - PRIMARY KEY (`id`), - KEY (`start_ip_int`, `end_ip_int`), - KEY (`start_time`, `end_time`), - KEY (`created_at`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8; - -CREATE TABLE `session` ( - `sid` char(128) NOT NULL, - `username` varchar(64) DEFAULT '', - `remote_addr` varchar(32) DEFAULT '', - `created_at` integer unsigned DEFAULT '0', - `updated_at` integer unsigned DEFAULT '0' NOT NULL, - PRIMARY KEY (`sid`), - KEY (`username`), - KEY (`updated_at`) -) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; - -alter table user add `login_err_num` int unsigned not null default 0 after leader_name; - -alter table user add `active_begin` bigint not null default 0 after login_err_num; -alter table user add `active_end` bigint not null default 0 after active_begin; -alter table user add `locked_at` bigint not null default 0 after active_end; -alter table user add `updated_at` bigint not null default 0 after locked_at; -alter table user add `pwd_updated_at` bigint not null default 0 after updated_at; -alter table user add `logged_at` bigint not null default 0 after pwd_updated_at; -alter table user add `passwords` varchar(512) not null default '' after password; -alter table login_log add `err` varchar(128) not null default '' after loginout; diff --git a/sql/upgrade/n9e_mon-v3.4.0.sql b/sql/upgrade/n9e_mon-v3.4.0.sql new file mode 100644 index 00000000..c10db7c2 --- /dev/null +++ b/sql/upgrade/n9e_mon-v3.4.0.sql @@ -0,0 +1,25 @@ +set names utf8; +use n9e_mon; + +CREATE TABLE `collect_rule` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `nid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'nid', + `step` int(11) NOT NULL DEFAULT '0' COMMENT 'step', + `timeout` int(11) NOT NULL DEFAULT '0' COMMENT 'total timeout', + `collect_type` varchar(64) NOT NULL DEFAULT '' COMMENT 'collector name', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name', + `region` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'region', + `comment` varchar(512) NOT NULL DEFAULT '' COMMENT 'comment', + `data` blob NULL COMMENT 'data', + `tags` varchar(512) NOT NULL DEFAULT '' COMMENT 'tags', + `creator` varchar(64) NOT NULL DEFAULT '' COMMENT 'creator', + `last_updator` varchar(64) NOT NULL DEFAULT '' COMMENT 'last_updator', + `created` datetime NOT NULL COMMENT 'created', + `last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `idx_nid` (`nid`), + KEY `idx_collect_type` (`collect_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'api collect'; + + + diff --git a/sql/upgrade/n9e_rdb-v3.4.0.sql b/sql/upgrade/n9e_rdb-v3.4.0.sql new file mode 100644 index 00000000..34ac2577 --- /dev/null +++ b/sql/upgrade/n9e_rdb-v3.4.0.sql @@ -0,0 +1,42 @@ +set names utf8; +use n9e_rdb; + +CREATE TABLE `white_list` ( + `id` bigint unsigned not null AUTO_INCREMENT, + `start_ip` varchar(32) DEFAULT '0' NOT NULL, + `end_ip` varchar(32) DEFAULT '0' NOT NULL, + `start_ip_int` bigint DEFAULT '0' NOT NULL, + `end_ip_int` bigint DEFAULT '0' NOT NULL, + `start_time` bigint DEFAULT '0' NOT NULL, + `end_time` bigint DEFAULT '0' NOT NULL, + `created_at` bigint DEFAULT '0' NOT NULL, + `updated_at` bigint DEFAULT '0' NOT NULL, + `creator` varchar(64) DEFAULT '' NOT NULL, + `updater` varchar(64) DEFAULT '' NOT NULL, + PRIMARY KEY (`id`), + KEY (`start_ip_int`, `end_ip_int`), + KEY (`start_time`, `end_time`), + KEY (`created_at`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8; + +CREATE TABLE `session` ( + `sid` char(128) NOT NULL, + `username` varchar(64) DEFAULT '', + `remote_addr` varchar(32) DEFAULT '', + `created_at` integer unsigned DEFAULT '0', + `updated_at` integer unsigned DEFAULT '0' NOT NULL, + PRIMARY KEY (`sid`), + KEY (`username`), + KEY (`updated_at`) +) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8; + +alter table user add `login_err_num` int unsigned not null default 0 after leader_name; + +alter table user add `active_begin` bigint not null default 0 after login_err_num; +alter table user add `active_end` bigint not null default 0 after active_begin; +alter table user add `locked_at` bigint not null default 0 after active_end; +alter table user add `updated_at` bigint not null default 0 after locked_at; +alter table user add `pwd_updated_at` bigint not null default 0 after updated_at; +alter table user add `logged_at` bigint not null default 0 after pwd_updated_at; +alter table user add `passwords` varchar(512) not null default '' after password; +alter table login_log add `err` varchar(128) not null default '' after loginout;