upgrade 3.4.0

This commit is contained in:
Ulric Qin 2021-01-01 10:46:59 +08:00
parent d45ea02562
commit e85debddfc
6 changed files with 69 additions and 67 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# release version
version=3.3.1
version=3.4.0
CWD=$(cd $(dirname $0)/; pwd)
cd $CWD

View File

@ -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 .

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -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;