--
-- Table structure for table `audit`
--

DROP TABLE IF EXISTS `audit`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `audit` (
  `ID` int(11) NOT NULL auto_increment,
  `ts` datetime NOT NULL default '0000-00-00 00:00:00',
  `username` varchar(255) NOT NULL default '',
  `accessGroups` varchar(255) NOT NULL default '',
  `action` varchar(255) NOT NULL default '',
  `object` varchar(255) NOT NULL default '',
  `value` text NOT NULL,
  `error` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=676 DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `network`
--

DROP TABLE IF EXISTS `network`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `network` (
  `ID` int(11) NOT NULL auto_increment,
  `rootID` int(11) NOT NULL default '0',
  `network` bigint(40) NOT NULL default '0',
  `description` varchar(255) NOT NULL default '',
  `state` smallint(6) NOT NULL default '0',
  `defSubnetSize` tinyint(4) unsigned NOT NULL default '0',
  `tmplID` int(11) NOT NULL default '0',
  `ipv6ID` varbinary(22) NOT NULL default '',
  `createFrom` varchar(255) NOT NULL default '',
  `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifyFrom` varchar(255) NOT NULL default '',
  `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `rootID` (`rootID`,`ipv6ID`,`network`),
  KEY `network` (`network`)
) ENGINE=InnoDB AUTO_INCREMENT=35184 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `networkAC`
--

DROP TABLE IF EXISTS `networkAC`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `networkAC` (
  `ID` int(11) NOT NULL auto_increment,
  `rootID` int(11) NOT NULL default '0',
  `network` bigint(40) NOT NULL default '0',
  `netID` int(11) NOT NULL default '0',
  `groupID` int(11) NOT NULL default '0',
  `ACL` int(11) NOT NULL default '0',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `netID` (`netID`,`groupID`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `networkPlugin`
--

DROP TABLE IF EXISTS `networkPlugin`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `networkPlugin` (
  `ID` int(11) NOT NULL auto_increment,
  `netID` int(11) NOT NULL default '0',
  `pluginID` int(11) NOT NULL default '0',
  `sequence` int(11) NOT NULL default '0',
  `newLine` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `netID` (`netID`,`pluginID`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `networkV6`
--

DROP TABLE IF EXISTS `networkV6`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `networkV6` (
  `ID` varbinary(22) NOT NULL default '',
  `rootID` int(11) NOT NULL default '0',
  `networkPrefix` bigint(20) unsigned NOT NULL default '0',
  `hostPart` bigint(20) unsigned NOT NULL default '0',
  `cidr` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`ID`,`rootID`),
  UNIQUE KEY `rootID` (`rootID`,`networkPrefix`,`hostPart`,`cidr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `plugin`
--

DROP TABLE IF EXISTS `plugin`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `plugin` (
  `ID` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `filename` varchar(255) NOT NULL default '',
  `active` tinyint(4) NOT NULL default '0',
  `lastRun` datetime NOT NULL default '0000-00-00 00:00:00',
  `runTime` int(11) NOT NULL default '0',
  `lastError` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `pluginConf`
--

DROP TABLE IF EXISTS `pluginConf`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pluginConf` (
  `ID` int(11) NOT NULL auto_increment,
  `netID` int(11) NOT NULL,
  `pluginID` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `netID` (`netID`,`pluginID`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `pluginValue`
--

DROP TABLE IF EXISTS `pluginValue`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `pluginValue` (
  `ID` int(11) NOT NULL auto_increment,
  `netID` int(11) NOT NULL,
  `pluginID` int(11) NOT NULL,
  `origin` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `netID` (`netID`,`pluginID`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `root`
--

DROP TABLE IF EXISTS `root`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `root` (
  `ID` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `ipv6` tinyint(1) NOT NULL default '0',
  `createFrom` varchar(255) NOT NULL default '',
  `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifyFrom` varchar(255) NOT NULL default '',
  `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=98 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `rootAC`
--

DROP TABLE IF EXISTS `rootAC`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `rootAC` (
  `ID` int(11) NOT NULL auto_increment,
  `rootID` int(11) NOT NULL default '0',
  `groupID` int(11) NOT NULL default '0',
  `ACL` int(11) NOT NULL default '0',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `rootID` (`rootID`,`groupID`)
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `setting`
--

DROP TABLE IF EXISTS `setting`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `setting` (
  `ID` int(11) NOT NULL auto_increment,
  `userID` int(11) NOT NULL default '0',
  `param` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `userID` (`userID`,`param`,`value`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `squad`
--

DROP TABLE IF EXISTS `squad`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `squad` (
  `ID` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `permissions` int(11) NOT NULL default '0',
  `createFrom` varchar(255) NOT NULL default '',
  `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifyFrom` varchar(255) NOT NULL default '',
  `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `template`
--

DROP TABLE IF EXISTS `template`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `template` (
  `ID` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `type` varchar(64) NOT NULL default '',
  `createFrom` varchar(255) NOT NULL default '',
  `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifyFrom` varchar(255) NOT NULL default '',
  `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `templateEntry`
--

DROP TABLE IF EXISTS `templateEntry`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `templateEntry` (
  `ID` int(11) NOT NULL auto_increment,
  `tmplID` int(11) NOT NULL default '0',
  `type` int(11) NOT NULL default '0',
  `position` int(11) NOT NULL default '0',
  `description` varchar(255) NOT NULL default '',
  `size` int(11) NOT NULL default '1',
  `entries` text NOT NULL,
  `rows` int(11) NOT NULL default '1',
  `cols` int(11) NOT NULL default '1',
  PRIMARY KEY  (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `templateValue`
--

DROP TABLE IF EXISTS `templateValue`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `templateValue` (
  `ID` int(11) NOT NULL auto_increment,
  `tmplID` int(11) NOT NULL default '0',
  `tmplEntryID` int(11) NOT NULL default '0',
  `netID` int(11) NOT NULL default '0',
  `value` blob NOT NULL,
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `netID` (`netID`,`tmplID`,`tmplEntryID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `user`
--

DROP TABLE IF EXISTS `user`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `user` (
  `ID` int(11) NOT NULL auto_increment,
  `username` varchar(100) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `groupIDs` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `createFrom` varchar(255) NOT NULL default '',
  `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
  `modifyFrom` varchar(255) NOT NULL default '',
  `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
--
-- Table structure for table `networkLock`
--

DROP TABLE IF EXISTS `networkLock`;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `networkLock` (
  `ID` int(11) NOT NULL auto_increment,
  `ts` datetime NOT NULL default '0000-00-00 00:00:00',
  `duration` int(11) NOT NULL default '0',
  `rootID` int(11) NOT NULL default '0',
  `networkPrefix` bigint(20) unsigned NOT NULL default '0',
  `hostPart` bigint(20) unsigned NOT NULL default '0',
  `cidr` smallint(6) NOT NULL default '0',
  `ipv6` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`ID`),
  UNIQUE KEY `rootID` (`rootID`,`networkPrefix`,`hostPart`,`cidr`,`ipv6`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
