# --------------------------------------------------------
#
# Table structure for table `events_log`
#

CREATE TABLE `events_log` (
  `id` int(11) NOT NULL auto_increment,
  `date` datetime NOT NULL,
  `user_id` int(11) NOT NULL,
  `entity_type` varchar(50) NOT NULL,
  `entity_id` int(11) NOT NULL,
  `action` varchar(100) NOT NULL,
  `subject` int(11) NOT NULL,
  `ip` varchar(15) NOT NULL DEFAULT '0',
  `params` text NOT NULL,
  PRIMARY KEY  (`id`)
) DEFAULT CHARACTER SET utf8, ENGINE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `cache`
#

CREATE TABLE `cache` (
  `cachekey` varchar(50) NOT NULL default '',
  `lastupdated` datetime NOT NULL default '0000-00-00 00:00:00',
  `content` mediumblob NOT NULL,
  PRIMARY KEY  (`cachekey`)
) DEFAULT CHARACTER SET utf8, ENGINE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `country`
#

CREATE TABLE `country` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(80) NOT NULL default '',
  `iso` char(2) NOT NULL default '',
  `phone_code` varchar(10) NOT NULL default '',
  `exists` tinyint(4) NOT NULL default '1',
  PRIMARY KEY  (`id`),
  KEY `by_name` (`name`,`iso`),
  KEY `by_iso` (`iso`,`name`)
) DEFAULT CHARACTER SET utf8, ENGINE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `permissions`
#

CREATE TABLE `permissions` (
  `subject_id` int(11) NOT NULL default '0',
  `is_group` tinyint(4) NOT NULL default '0',
  `permission` varchar(100) NOT NULL default '',
  `target_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`subject_id`,`is_group`,`permission`,`target_id`)
) DEFAULT CHARACTER SET utf8, ENGINE=MyISAM;

# --------------------------------------------------------

#
# Table structure for table `setting`
#

CREATE TABLE `setting` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) default NULL,
  `value` text NOT NULL,
  `value_alternate` text,
  `description` text NOT NULL,
  `type` tinyint(4) NOT NULL default '0',
  `isrequired` tinyint(4) NOT NULL default '1',
  `istruefalse` tinyint(4) NOT NULL default '0',
  `istextarea` tinyint(4) NOT NULL default '0',
  `issmalltextarea` tinyint(4) NOT NULL default '0',
  `isfromoptions` tinyint(4) NOT NULL default '0',
  `myorder` int(11) NOT NULL default '0',
  `helpid` int(3) default '0',
  `plugin` tinyint(4) NOT NULL default '0',
  `ispassword` tinyint(4) NOT NULL default '0',
  `ishidden` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `id_2` (`id`),
  KEY `plugin` (`plugin`)
) DEFAULT CHARACTER SET utf8, ENGINE=MyISAM AUTO_INCREMENT=133 ;


# --------------------------------------------------------

#
# Table structure for table `versions`
#

CREATE TABLE `versions` (
    `module` VARCHAR( 50 ) NOT NULL ,
    `version` VARCHAR( 50 ) NOT NULL
) DEFAULT CHARACTER SET utf8, ENGINE = MYISAM ;

# --------------------------------------------------------

#
# Table structure for table `user_groups`
#

CREATE TABLE `user_groups` (
    `user_id` INT NOT NULL ,
    `group_id` INT NOT NULL ,
    PRIMARY KEY ( `user_id` , `group_id` )
) DEFAULT CHARACTER SET utf8, ENGINE = MYISAM ;

# --------------------------------------------------------
