-- NeonServ Database v5.1

--
-- Tabellenstruktur für Tabelle `bans`
--

CREATE TABLE IF NOT EXISTS `bans` (
  `ban_id` int(11) NOT NULL AUTO_INCREMENT,
  `ban_channel` int(11) NOT NULL,
  `ban_mask` varchar(250) NOT NULL,
  `ban_triggered` int(15) NOT NULL,
  `ban_timeout` int(15) NOT NULL,
  `ban_owner` int(11) NOT NULL,
  `ban_reason` varchar(512) NOT NULL,
  PRIMARY KEY (`ban_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `bots`
--

CREATE TABLE IF NOT EXISTS `bots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `active` tinyint(1) NOT NULL,
  `nick` varchar(255) NOT NULL,
  `server` varchar(255) NOT NULL,
  `port` int(5) NOT NULL,
  `pass` varchar(255) NOT NULL,
  `ssl` tinyint(1) NOT NULL,
  `bind` varchar(255) DEFAULT NULL,
  `ident` varchar(12) NOT NULL,
  `realname` varchar(255) NOT NULL,
  `automodes` varchar(20) NOT NULL,
  `botclass` int(10) NOT NULL,
  `textbot` tinyint(1) NOT NULL,
  `queue` tinyint(1) NOT NULL,
  `defaulttrigger` varchar(10) NOT NULL,
  `max_channels` int(5) NOT NULL,
  `register_priority` int(2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nick` (`nick`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `bot_binds`
--

CREATE TABLE IF NOT EXISTS `bot_binds` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `botclass` int(11) NOT NULL,
  `command` varchar(60) NOT NULL,
  `function` varchar(60) NOT NULL,
  `parameters` varchar(100) NOT NULL,
  `chan_access` varchar(256) DEFAULT NULL,
  `global_access` int(3) DEFAULT NULL,
  `flags` tinyint(4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `bot_channels`
--

CREATE TABLE IF NOT EXISTS `bot_channels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `botid` int(11) NOT NULL,
  `chanid` int(11) NOT NULL,
  `trigger` varchar(50) NOT NULL DEFAULT '+',
  `suspended` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `channels`
--

CREATE TABLE IF NOT EXISTS `channels` (
  `channel_id` int(11) NOT NULL AUTO_INCREMENT,
  `channel_name` varchar(250) NOT NULL,
  `channel_key` varchar(50) NOT NULL,
  `channel_maxusers` int(5) NOT NULL,
  `channel_lastvisit` int(11) NOT NULL,
  `channel_lastgiveowner` int(15) NOT NULL,
  `channel_pubcmd` smallint(3) DEFAULT NULL,
  `channel_nodelete` tinyint(1) NOT NULL,
  `channel_nogaccess` tinyint(1) DEFAULT NULL,
  `channel_canadd` smallint(3) DEFAULT NULL,
  `channel_candel` smallint(3) DEFAULT NULL,
  `channel_canclvl` smallint(3) DEFAULT NULL,
  `channel_cankick` smallint(3) DEFAULT NULL,
  `channel_canban` smallint(3) DEFAULT NULL,
  `channel_staticban` smallint(3) DEFAULT NULL,
  `channel_protect` tinyint(1) DEFAULT NULL,
  `channel_canop` smallint(3) DEFAULT NULL,
  `channel_canvoice` smallint(3) DEFAULT NULL,
  `channel_getop` smallint(3) DEFAULT NULL,
  `channel_getvoice` smallint(3) DEFAULT NULL,
  `channel_greeting` varchar(512) NOT NULL,
  `channel_usergreeting` varchar(512) NOT NULL,
  `channel_userinfo` smallint(3) DEFAULT NULL,
  `channel_dynlimit` smallint(5) DEFAULT NULL,
  `channel_getinvite` smallint(3) DEFAULT NULL,
  `channel_topicmask` varchar(512) NOT NULL,
  `channel_exttopic` tinyint(1) NOT NULL,
  `channel_exttopic_topic` varchar(512) NOT NULL,
  `channel_defaulttopic` varchar(512) NOT NULL,
  `channel_wipeinfo` smallint(3) DEFAULT NULL,
  `channel_modes` varchar(500) DEFAULT NULL,
  `channel_enfmodes` smallint(3) DEFAULT NULL,
  `channel_enftopic` smallint(3) DEFAULT NULL,
  `channel_topicsnarf` smallint(3) DEFAULT NULL,
  `channel_changetopic` smallint(3) DEFAULT NULL,
  `channel_setters` smallint(3) DEFAULT NULL,
  `channel_canresync` smallint(3) DEFAULT NULL,
  `channel_cansuspend` smallint(3) DEFAULT NULL,
  `channel_notice` smallint(3) DEFAULT NULL,
  `channel_noticereaction` tinyint(1) DEFAULT NULL,
  `channel_ctcp` smallint(3) DEFAULT NULL,
  `channel_ctcpreaction` tinyint(1) DEFAULT NULL,
  `channel_registered` int(11) NOT NULL,
  `channel_registrator` int(11) NOT NULL,
  `channel_toys` tinyint(1) NOT NULL,
  `channel_scanner` varchar(50) DEFAULT NULL,
  `channel_spam_limit` smallint(3) DEFAULT NULL,
  `channel_spam_reaction` tinyint(1) DEFAULT NULL,
  `channel_spam_reaction_duration` mediumint(7) DEFAULT NULL,
  `channel_spam_except` smallint(3) DEFAULT NULL,
  `channel_flood_limit` smallint(3) DEFAULT NULL,
  `channel_flood_time` smallint(3) DEFAULT NULL,
  `channel_flood_reaction` tinyint(1) DEFAULT NULL,
  `channel_flood_reaction_duration` mediumint(7) DEFAULT NULL,
  `channel_flood_except` smallint(3) DEFAULT NULL,
  `channel_join_limit` smallint(3) DEFAULT NULL,
  `channel_join_time` smallint(3) DEFAULT NULL,
  `channel_join_reaction` tinyint(1) DEFAULT NULL,
  `channel_join_reaction_duration` mediumint(7) DEFAULT NULL,
  `channel_join_except` smallint(3) DEFAULT NULL,
  `channel_botnet_bantime` mediumint(7) DEFAULT NULL,
  `channel_botnet_except` smallint(3) DEFAULT NULL,
  `channel_caps_percent` tinyint(3) DEFAULT NULL,
  `channel_caps_reaction` tinyint(1) DEFAULT NULL,
  `channel_caps_reaction_duration` mediumint(7) DEFAULT NULL,
  `channel_caps_except` smallint(3) DEFAULT NULL,
  `channel_digit_percent` tinyint(3) DEFAULT NULL,
  `channel_digit_reaction` tinyint(1) DEFAULT NULL,
  `channel_digit_reaction_duration` mediumint(7) DEFAULT NULL,
  `channel_digit_except` smallint(3) DEFAULT NULL,
  PRIMARY KEY (`channel_id`),
  UNIQUE KEY `channel_name` (`channel_name`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `chanusers`
--

CREATE TABLE IF NOT EXISTS `chanusers` (
  `chanuser_id` int(11) NOT NULL AUTO_INCREMENT,
  `chanuser_cid` int(11) NOT NULL,
  `chanuser_uid` int(11) NOT NULL,
  `chanuser_access` int(3) NOT NULL,
  `chanuser_flags` int(11) NOT NULL,
  `chanuser_seen` int(11) NOT NULL,
  `chanuser_infoline` varchar(512) NOT NULL,
  PRIMARY KEY (`chanuser_id`),
  KEY `chanuser_cid` (`chanuser_cid`),
  KEY `chanuser_uid` (`chanuser_uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `events`
--

CREATE TABLE IF NOT EXISTS `events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` int(11) NOT NULL,
  `nick` varchar(50) NOT NULL,
  `auth` varchar(50) NOT NULL,
  `time` int(11) NOT NULL,
  `command` varchar(512) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `cid` (`cid`),
  KEY `time` (`time`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `funcmd`
--

CREATE TABLE IF NOT EXISTS `funcmd` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lang` int(11) NOT NULL,
  `cmd` varchar(50) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='neonserv v3';

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `fundata`
--

CREATE TABLE IF NOT EXISTS `fundata` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='neonserv v3';

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `godlog`
--

CREATE TABLE IF NOT EXISTS `godlog` (
  `godlog_id` int(11) NOT NULL AUTO_INCREMENT,
  `godlog_uid` int(11) NOT NULL,
  `godlog_cid` int(15) NOT NULL,
  `godlog_time` int(15) NOT NULL,
  `godlog_cmd` varchar(512) NOT NULL,
  PRIMARY KEY (`godlog_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `help`
--

CREATE TABLE IF NOT EXISTS `help` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lang` varchar(6) NOT NULL,
  `ident` varchar(64) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `language`
--

CREATE TABLE IF NOT EXISTS `language` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lang` varchar(5) NOT NULL,
  `ident` varchar(64) NOT NULL,
  `text` varchar(256) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `noinvite`
--

CREATE TABLE IF NOT EXISTS `noinvite` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `owner_history`
--


CREATE TABLE IF NOT EXISTS `owner_history` (
  `owner_history_id` int(11) NOT NULL AUTO_INCREMENT,
  `owner_history_cid` int(11) NOT NULL,
  `owner_history_to_uid` int(11) NOT NULL,
  `owner_history_from_uid` int(11) NOT NULL,
  `owner_history_time` int(11) NOT NULL,
  PRIMARY KEY (`owner_history_id`),
  KEY `owner_history_cid` (`owner_history_cid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_user` varchar(250) NOT NULL,
  `user_access` int(4) NOT NULL,
  `user_rank` int(11) NOT NULL,
  `user_god` tinyint(1) NOT NULL,
  `user_lang` varchar(6) NOT NULL,
  `user_reply_privmsg` tinyint(1) NOT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_user` (`user_user`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `support_ranks`
--

CREATE TABLE `support_ranks` (
`rank_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`rank_name` VARCHAR( 256 ) NOT NULL ,
`rank_access` INT( 4 ) NOT NULL ,
`rank_info` VARCHAR( 512 ) NOT NULL ,
`rank_order` SMALLINT( 4 ) NOT NULL
) ENGINE = MYISAM ;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `version`
--

CREATE TABLE IF NOT EXISTS `version` (
  `database_version` int(5) NOT NULL,
  PRIMARY KEY (`database_version`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `donotregister`
--

CREATE TABLE `donotregister` (
`dnr_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`dnr_target` VARCHAR( 256 ) NOT NULL ,
`dnr_user` INT( 11 ) NOT NULL ,
`dnr_timeout` INT( 20 ) NOT NULL ,
`dnr_reason` TEXT NOT NULL ,
UNIQUE (
`dnr_target`
)
) ENGINE = MYISAM ;