CREATE TABLE IF NOT EXISTS `user_acl_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role` varchar(255) NOT NULL,
  `type` enum('other','superadmin','default') NOT NULL default 'other',
  `createdby` int(11),
  `updatedby` int(11),
  `created` datetime NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `user_acl_roles_users` (
  `uid` int(11) NOT NULL COMMENT 'user id',
  `rid` int(11) NOT NULL COMMENT 'role id',
  UNIQUE KEY `uid` (`uid`,`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `user_acl_rules` (
  `rid` int(11) NOT NULL COMMENT 'role id',
  `name` varchar(255) NOT NULL,
  `value` TEXT NOT NULL,
  UNIQUE KEY `rid` (`rid`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `user_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `reset` varchar(255) NOT NULL DEFAULT '',
  `session` varchar(255) DEFAULT NULL,
  `lastip` varchar(15) NOT NULL DEFAULT '',
  `registerip` varchar(15) NOT NULL,
  `status` enum('Active','Inactive','Pending') NOT NULL DEFAULT 'Active',
  `createdby` int(11),
  `updatedby` int(11),
  `lastauth` datetime DEFAULT NULL,
  `created` datetime NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

