-- phpMyAdmin SQL Dump
-- version 2.10.1
-- http://www.phpmyadmin.net

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- Table structure for table `logcon_config`
-- 

DROP TABLE IF EXISTS `logcon_config`;
CREATE TABLE `logcon_config` (
  `propname` varchar(32) NOT NULL,
  `propvalue` varchar(255) NULL,
  `propvalue_text` text NULL,
  `is_global` tinyint(1) NOT NULL,
  `userid` int(11) default NULL,
  `groupid` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table to store global and user specific configurations';

-- 
-- Table structure for table `logcon_groupmembers`
-- 

DROP TABLE IF EXISTS `logcon_groupmembers`;
CREATE TABLE IF NOT EXISTS `logcon_groupmembers` (
  `userid` int(11) NOT NULL,
  `groupid` int(11) NOT NULL,
  `is_member` tinyint(1) NOT NULL default '1'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Helpertable to store which users are in which group';

-- 
-- Table structure for table `logcon_groups`
-- 

DROP TABLE IF EXISTS `logcon_groups`;
CREATE TABLE IF NOT EXISTS `logcon_groups` (
  `ID` int(11) NOT NULL auto_increment,
  `groupname` varchar(32) NOT NULL,
  `groupdescription` varchar(255) NOT NULL,
  `grouptype` int(11) NOT NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Table for phplogcon groups' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_searches`
-- 

DROP TABLE IF EXISTS `logcon_searches`;
CREATE TABLE IF NOT EXISTS `logcon_searches` (
  `ID` int(11) NOT NULL auto_increment,
  `DisplayName` varchar(255) NOT NULL,
  `SearchQuery` varchar(1024) NOT NULL,
  `userid` int(11) default NULL,
  `groupid` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Stores custom user searches' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_sources`
-- 

DROP TABLE IF EXISTS `logcon_sources`;
CREATE TABLE `logcon_sources` (
  `ID` int(11) NOT NULL auto_increment,
  `Name` varchar(255) NOT NULL,
  `Description` text NOT NULL,
  `SourceType` tinyint(4) NOT NULL,
  `MsgParserList` varchar(255) NOT NULL,
  `MsgNormalize` tinyint(1) NOT NULL default '0',
  `MsgSkipUnparseable` tinyint(1) NOT NULL default '0',
  `ViewID` varchar(64) NOT NULL,
  `LogLineType` varchar(64) default NULL,
  `DiskFile` varchar(255) default NULL,
  `DBTableType` varchar(64) default NULL,
  `DBType` tinyint(4) default NULL,
  `DBServer` varchar(255) default NULL,
  `DBName` varchar(64) default NULL,
  `DBUser` varchar(64) default NULL,
  `DBPassword` varchar(255) default NULL,
  `DBTableName` varchar(64) default NULL,
  `DBEnableRowCounting` tinyint(1) default NULL,
  `DBRecordsPerQuery` int(11) NOT NULL default '100',
  `defaultfilter` VARCHAR(1024) NOT NULL, 
  `userid` int(11) default NULL,
  `groupid` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Table to store datasources in phplogcon' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_users`
-- 

DROP TABLE IF EXISTS `logcon_users`;
CREATE TABLE IF NOT EXISTS `logcon_users` (
  `ID` int(11) NOT NULL auto_increment,
  `username` varchar(32) NOT NULL,
  `password` varchar(32) NOT NULL,
  `is_admin` tinyint(1) NOT NULL default '0',
  `is_readonly` tinyint(1) NOT NULL DEFAULT '0', 
  `last_login` int(4) NOT NULL DEFAULT '0',
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Table for the phplogcon users' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_views`
-- 

DROP TABLE IF EXISTS `logcon_views`;
CREATE TABLE IF NOT EXISTS `logcon_views` (
  `ID` int(11) NOT NULL auto_increment,
  `DisplayName` varchar(255) NOT NULL,
  `Columns` text NOT NULL,
  `userid` int(11) default NULL,
  `groupid` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Stores custom defined user views.' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_charts`
-- 

DROP TABLE IF EXISTS `logcon_charts`;
CREATE TABLE IF NOT EXISTS `logcon_charts` (
  `ID` int(11) NOT NULL auto_increment,
  `DisplayName` varchar(255) NOT NULL,
  `chart_enabled` tinyint(1) NOT NULL default '1',
  `chart_type` int(11) NOT NULL,
  `chart_width` int(11) NOT NULL,
  `chart_field` varchar(255) NOT NULL,
  `chart_defaultfilter` VARCHAR(1024) NOT NULL, 
  `maxrecords` int(11) NOT NULL,
  `showpercent` tinyint(1) NOT NULL,
  `userid` int(11) default NULL,
  `groupid` int(11) default NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='This table contains all configured charts' AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_fields`
-- 

DROP TABLE IF EXISTS `logcon_fields`;
CREATE TABLE `logcon_fields` (
  `FieldID` varchar(64) NOT NULL,
  `FieldDefine` varchar(64) NOT NULL,
  `FieldCaption` varchar(255) NOT NULL,
  `FieldType` int(11) NOT NULL,
  `Sortable` tinyint(1) NOT NULL,
  `DefaultWidth` int(11) NOT NULL,
  `FieldAlign` varchar(32) NOT NULL,
  `SearchField` varchar(64) NOT NULL,
  `SearchOnline` tinyint(1) NOT NULL,
  `Trunscate` int(11) NOT NULL,
  PRIMARY KEY  (`FieldID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='This table stores custom fields';

-- 
-- Table structure for table `logcon_dbmappings`
-- 

DROP TABLE IF EXISTS `logcon_dbmappings`;
CREATE TABLE `logcon_dbmappings` (
  `ID` int(11) NOT NULL auto_increment,
  `DisplayName` varchar(64) NOT NULL,
  `Mappings` varchar(1024) NOT NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- 
-- Table structure for table `logcon_savedreports`
-- 

DROP TABLE IF EXISTS `logcon_savedreports`;
CREATE TABLE `logcon_savedreports` (
  `ID` int(11) NOT NULL auto_increment,
  `reportid` varchar(255) NOT NULL,
  `sourceid` int(11) NOT NULL,
  `customTitle` varchar(255) NOT NULL,
  `customComment` text NOT NULL,
  `filterString` text NOT NULL,
  `customFilters` text NOT NULL,
  `outputFormat` varchar(64) NOT NULL,
  `outputTarget` varchar(64) NOT NULL,
  `outputTargetDetails` text NOT NULL,
  `scheduleSettings` text NOT NULL,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT = 'Table to store saved reports' AUTO_INCREMENT=1 ;

