

CREATE TABLE `AuthAttempts` (
  `attemptId` int(11) NOT NULL AUTO_INCREMENT,
  `attemptIp` varchar(39) NOT NULL,
  `attemptExpireDate` datetime NOT NULL,
  PRIMARY KEY (`attemptId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthConfig` (
  `configSetting` varchar(100) NOT NULL,
  `configValue` varchar(100) DEFAULT NULL,
  UNIQUE KEY `vSetting` (`configSetting`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;



CREATE TABLE `AuthRequests` (
  `requestId` int(11) NOT NULL AUTO_INCREMENT,
  `requestUserId` int(11) NOT NULL,
  `requestRkey` varchar(20) NOT NULL,
  `requestExpireDate` datetime NOT NULL,
  `requestType` varchar(20) NOT NULL,
  PRIMARY KEY (`requestId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthSessions` (
  `sessionId` int(11) NOT NULL AUTO_INCREMENT,
  `sessionUserId` int(11) NOT NULL,
  `sessionHash` varchar(40) NOT NULL,
  `sessionExpireDate` datetime NOT NULL,
  `sessionIp` varchar(39) NOT NULL,
  `sessionAgent` varchar(200) NOT NULL,
  `sessionCookie_crc` varchar(40) NOT NULL,
  PRIMARY KEY (`sessionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthRoles` (
  `roleId` int(11) NOT NULL AUTO_INCREMENT,
  `roleDescription` varchar(100) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`roleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthUsers` (
  `userId` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(60) DEFAULT NULL,
  `userName` varchar(100) DEFAULT NULL,
  `userEmail` varchar(100) DEFAULT NULL,
  `userPassword` varchar(100) DEFAULT NULL,
  `userIsActive` tinyint(1) NOT NULL DEFAULT '0',
  `userCreteTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `userRoleId` int(11),
  PRIMARY KEY (`userId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthPermissions` (
  `permisionId` int(11) NOT NULL AUTO_INCREMENT,
  `permissionDescription` varchar(100) DEFAULT NULL,
  `isActive` tinyint(1) NOT NULL DEFAULT '0',
   PRIMARY KEY (`permisionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `AuthRelRolPermission` (
   `roleId` int(11) NOT NULL,
   `permissionId` int(11) NOT NULL,
    PRIMARY KEY (`roleId`,`permissionId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




-- 2015-11-06 14:09:37
