--
--keyinfo
--
create table keyinfo(
								serialnum varchar(20) not null,
	 							userkey varchar(20) not null,
	 							hcounter number(10)  default 0,
	 							lcounter number(10)  default 0,
	 							tktype number(2)  default 1,
	 							predate date not null,
								state number(2) default 0,
								domain varchar(20) default null,
								importdate date not null,
								diglen number(4) default 6,
							  authwnd number(11)  default 30,
							  tmstep number(11) default 60,
	 							primary key(serialnum)
								);
								
--
--loginfo
--

create table commonloginfo(
								optime date not null,
	 							operator varchar(20) not null,
	 							loglev number(3) not null,
								optype number(3) not null,
								remark varchar(250),
								domain varchar(20) default null,
								remoteip varchar(16) not null);

--	 							
--operactorinfo
--

create table operatorinfo(
								operatorid number(10) not null,
	 							passwd char(40) not null,
	 							operatorlev number(3) not null,
	 							operatorname varchar(20) not null,
								domain varchar(20) default null,
	 							primary key(operatorid));
insert into operatorinfo (operatorid, passwd, operatorlev, operatorname) values(1000000001,'7c4a8d09ca3762af61e59520943dc26494f8941b',1,'super_administrator');

--
--table sysloginfo
--

create table sysloginfo(
								optime date not null,
								operator varchar(20) not null,
								loglev number(3) not null,
								optype number(3) not null,
								remark varchar(1000),
								domain varchar(20) default null);

--userinfo
--
create table userinfo(
								username varchar(20) not null,
 								userid varchar(30) not null,
 								contacttel varchar(20)not null,
 								islocked number(2) default 0,
 								failaccum number(2) default 0,
 								preusedate date default null,
 								serialnum varchar(20) default null,
 								isdeleted number(2) default 0,
 								remark varchar(250),
 								user_email varchar(30),
								domain varchar(20) default null,
								pin varchar(20) not null,
								authtype number(2) default 2,
 								primary key(username));															