-- http://www.phpmyadmin.net
--
-- Počítač: localhost
-- Vygenerováno: Úte 10. led 2012, 10:14
-- Verze MySQL: 5.1.58
-- Verze PHP: 5.3.8




--
-- Databáze: `is`
--

DELIMITER $$
--
-- Funkce
--
CREATE DEFINER=`centrala`@`localhost` FUNCTION `CompareNetworkPrefix`(Address1 INT(11) UNSIGNED, Address2 INT(11) UNSIGNED, Size INT(11)) RETURNS tinyint(1)
RETURN Address1 & (-1 << (32 - Size)) = Address2 & (-1 << (32 - Size))$$

DELIMITER ;

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

--
-- Struktura tabulky `ChatHistory`
--

CREATE TABLE IF NOT EXISTS `ChatHistory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Nick` varchar(64) COLLATE utf8_czech_ci NOT NULL,
  `Text` text COLLATE utf8_czech_ci NOT NULL,
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Color` int(11) NOT NULL DEFAULT '0',
  `RoomName` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `RoomType` int(11) NOT NULL DEFAULT '0',
  `Host` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=528576 ;

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

--
-- Struktura tabulky `DocumentLine`
--

CREATE TABLE IF NOT EXISTS `DocumentLine` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Shortcut` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Shortcut` (`Shortcut`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;

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

--
-- Struktura tabulky `DocumentLineSequence`
--

CREATE TABLE IF NOT EXISTS `DocumentLineSequence` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `DocumentLine` int(11) NOT NULL,
  `FinanceYear` int(11) NOT NULL,
  `NextNumber` int(11) NOT NULL,
  `YearPrefix` int(11) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `DocumentLine` (`DocumentLine`),
  KEY `FinanceYear` (`FinanceYear`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=25 ;

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

--
-- Struktura tabulky `EmailQueue`
--

CREATE TABLE IF NOT EXISTS `EmailQueue` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Time` datetime NOT NULL,
  `Address` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Subject` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Content` text COLLATE utf8_czech_ci NOT NULL,
  `Headers` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Archive` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `Archive` (`Archive`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2107 ;

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

--
-- Struktura tabulky `File`
--

CREATE TABLE IF NOT EXISTS `File` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(256) COLLATE utf8_czech_ci NOT NULL,
  `Size` int(11) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `FinanceAssetsHistory`
--

CREATE TABLE IF NOT EXISTS `FinanceAssetsHistory` (
  `AssetsId` int(11) NOT NULL DEFAULT '0',
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `User` int(11) NOT NULL DEFAULT '0',
  KEY `AssetsId` (`AssetsId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `FinanceBankAccount`
--

CREATE TABLE IF NOT EXISTS `FinanceBankAccount` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `TimeCreate` date NOT NULL,
  `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;

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

--
-- Struktura tabulky `FinanceBillingPeriod`
--

CREATE TABLE IF NOT EXISTS `FinanceBillingPeriod` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `MonthCount` int(11) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;

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

--
-- Struktura tabulky `FinanceBills`
--

CREATE TABLE IF NOT EXISTS `FinanceBills` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `TimeFrom` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Subject` int(11) NOT NULL DEFAULT '0',
  `TimeTo` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimeCreate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `BillCode` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `Type` enum('invoice','income') COLLATE utf8_czech_ci NOT NULL,
  `Cash` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `Subject` (`Subject`),
  KEY `Subject_2` (`Subject`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4957 ;

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

--
-- Struktura tabulky `FinanceBillsItems`
--

CREATE TABLE IF NOT EXISTS `FinanceBillsItems` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Bill` int(11) NOT NULL DEFAULT '0',
  `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Price` float NOT NULL DEFAULT '0',
  `Quantity` float NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  KEY `Bill` (`Bill`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16498 ;

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

--
-- Struktura tabulky `FinanceClaimsLiabilities`
--

CREATE TABLE IF NOT EXISTS `FinanceClaimsLiabilities` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `BillCode` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Subject` int(11) NOT NULL DEFAULT '0',
  `TimeCreation` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimePayment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Value` float NOT NULL DEFAULT '0',
  `Bill` int(11) DEFAULT '0',
  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`),
  KEY `Subject` (`Subject`),
  KEY `Bill` (`Bill`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7430 ;

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

--
-- Struktura tabulky `FinanceLog`
--

CREATE TABLE IF NOT EXISTS `FinanceLog` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `FinanceOperation`
--

CREATE TABLE IF NOT EXISTS `FinanceOperation` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Time` datetime NOT NULL,
  `Subject` int(11) NOT NULL DEFAULT '0',
  `Cash` int(11) NOT NULL DEFAULT '0',
  `Value` float NOT NULL,
  `BillCode` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `Taxable` tinyint(1) NOT NULL DEFAULT '1',
  `Bill` int(11) DEFAULT NULL,
  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT 'Vklad',
  `Network` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  KEY `Subject` (`Subject`),
  KEY `Bill` (`Bill`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=5779 ;

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

--
-- Struktura tabulky `FinanceSmallAssets`
--

CREATE TABLE IF NOT EXISTS `FinanceSmallAssets` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `PricePurchase` float NOT NULL DEFAULT '0',
  `TimeEnlistment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimeElimination` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `SupplySubject` int(11) NOT NULL DEFAULT '0',
  `DeviceId` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `FinanceTariff`
--

CREATE TABLE IF NOT EXISTS `FinanceTariff` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `Group` int(11) NOT NULL DEFAULT '0',
  `SpeedMin` int(11) NOT NULL DEFAULT '0',
  `SpeedMax` int(11) NOT NULL DEFAULT '0',
  `UploadAsymmetry` int(11) NOT NULL DEFAULT '1',
  `Price` int(11) NOT NULL DEFAULT '0',
  `MemberCount` int(11) NOT NULL DEFAULT '0',
  `ReplaceId` int(11) DEFAULT NULL,
  `Public` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  KEY `ReplaceId` (`ReplaceId`),
  KEY `Public` (`Public`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;

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

--
-- Struktura tabulky `FinanceYear`
--

CREATE TABLE IF NOT EXISTS `FinanceYear` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Year` int(11) NOT NULL,
  `DateStart` date NOT NULL,
  `DateEnd` date NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;

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

--
-- Struktura tabulky `finance_charge`
--

CREATE TABLE IF NOT EXISTS `finance_charge` (
  `period` int(11) NOT NULL DEFAULT '0',
  `internet` int(11) NOT NULL DEFAULT '0',
  `internet_speed` int(11) NOT NULL DEFAULT '0',
  `internet_speed_reserve` int(11) NOT NULL DEFAULT '0',
  `administration_per_user` int(20) NOT NULL DEFAULT '0',
  `kWh` int(11) NOT NULL DEFAULT '0',
  `base_speed_element` int(11) NOT NULL DEFAULT '0',
  `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
  `TopTariffPrice` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `finance_groups`
--

CREATE TABLE IF NOT EXISTS `finance_groups` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Description` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;

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

--
-- Struktura tabulky `finance_monthly_overall`
--

CREATE TABLE IF NOT EXISTS `finance_monthly_overall` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `money` int(11) NOT NULL DEFAULT '0',
  `date` date NOT NULL DEFAULT '0000-00-00',
  `administration` int(11) NOT NULL DEFAULT '0',
  `kWh` int(11) NOT NULL DEFAULT '0',
  `administration_total` int(11) NOT NULL DEFAULT '0',
  `consumption_total` int(11) NOT NULL DEFAULT '0',
  `total_paid` int(11) NOT NULL DEFAULT '0',
  `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
  `TopTariffPrice` int(11) NOT NULL DEFAULT '0',
  `member_count` int(11) NOT NULL DEFAULT '0',
  `investment` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=109 ;

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

--
-- Struktura tabulky `HostedProject`
--

CREATE TABLE IF NOT EXISTS `HostedProject` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `User` int(255) NOT NULL COMMENT 'User.Id',
  `TimeCreate` datetime NOT NULL,
  `Server` int(11) DEFAULT NULL COMMENT 'NetworkDevice.Id',
  `Active` int(11) NOT NULL DEFAULT '1',
  `WebHosting` int(11) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16 ;

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

--
-- Struktura tabulky `hosts_topology`
--

CREATE TABLE IF NOT EXISTS `hosts_topology` (
  `host` int(11) NOT NULL DEFAULT '0',
  `depth` int(11) NOT NULL DEFAULT '0',
  `pos` int(11) NOT NULL DEFAULT '0',
  `first` int(11) NOT NULL DEFAULT '0',
  `last` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`host`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `Hyperlink`
--

CREATE TABLE IF NOT EXISTS `Hyperlink` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `URL` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Group` int(11) NOT NULL,
  `IconFile` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `PermissionModule` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `PermissionOperation` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Enable` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  KEY `Group` (`Group`),
  KEY `Enable` (`Enable`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=66 ;

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

--
-- Struktura tabulky `HyperlinkGroup`
--

CREATE TABLE IF NOT EXISTS `HyperlinkGroup` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=10 ;

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

--
-- Struktura tabulky `Log`
--

CREATE TABLE IF NOT EXISTS `Log` (
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `User` int(11) NOT NULL DEFAULT '0',
  `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `Operation` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `Value` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  KEY `Time` (`Time`),
  KEY `User` (`User`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `Meals`
--

CREATE TABLE IF NOT EXISTS `Meals` (
  `Date` date NOT NULL DEFAULT '0000-00-00',
  `Soup` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Meal` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Status` int(11) NOT NULL DEFAULT '0',
  UNIQUE KEY `date` (`Date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;

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

--
-- Struktura tabulky `MealsInfo`
--

CREATE TABLE IF NOT EXISTS `MealsInfo` (
  `Info` text COLLATE utf8_czech_ci NOT NULL,
  `Price` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;

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

--
-- Struktura tabulky `Member`
--

CREATE TABLE IF NOT EXISTS `Member` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Subject` int(11) NOT NULL,
  `ResponsibleUser` int(11) NOT NULL,
  `FamilyMemberCount` int(11) NOT NULL,
  `MembershipDate` date NOT NULL,
  `MemberState` int(11) NOT NULL,
  `InternetTariffCurrentMonth` int(11) NOT NULL,
  `InternetTariffNextMonth` int(11) NOT NULL,
  `GPS` int(11) NOT NULL,
  `BillingPeriod` int(11) NOT NULL DEFAULT '2',
  `NetworkSegment` int(11) NOT NULL,
  `BillingPeriodNext` int(11) NOT NULL DEFAULT '2',
  `BillingPeriodLastDate` date NOT NULL,
  `Hire` float NOT NULL DEFAULT '0',
  `Blocked` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`),
  KEY `Subject` (`Subject`),
  KEY `ResponsibleUser` (`ResponsibleUser`),
  KEY `InternetTariffCurrentMonth` (`InternetTariffCurrentMonth`),
  KEY `InternetTariffNextMonth` (`InternetTariffNextMonth`),
  KEY `BillingPeriod` (`BillingPeriod`),
  KEY `BillingPeriodNext` (`BillingPeriodNext`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=177 ;

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

--
-- Struktura tabulky `MemberPayment`
--

CREATE TABLE IF NOT EXISTS `MemberPayment` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Member` int(11) NOT NULL,
  `MonthlyTotal` float NOT NULL,
  `MonthlyInternet` float NOT NULL,
  `MonthlyConsumption` float NOT NULL,
  `NetworkDevice` float NOT NULL,
  `MonthlyPlus` float NOT NULL,
  `Cash` float NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Member` (`Member`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=161 ;

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

--
-- Struktura tabulky `NetworkAP`
--

CREATE TABLE IF NOT EXISTS `NetworkAP` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `SSID` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Frequency` int(11) NOT NULL,
  `ChannelWidth` int(11) NOT NULL DEFAULT '20',
  `NetworkDevice` int(11) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  KEY `NetworkDevice` (`NetworkDevice`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=44 ;

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

--
-- Struktura tabulky `NetworkConfiguration`
--

CREATE TABLE IF NOT EXISTS `NetworkConfiguration` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Execute` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Changed` int(11) NOT NULL DEFAULT '0',
  `LastTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `ExecutionTime` int(11) NOT NULL,
  `Enabled` int(11) NOT NULL DEFAULT '1',
  `Period` int(11) NOT NULL DEFAULT '60',
  `Log` mediumtext COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;

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

--
-- Struktura tabulky `NetworkDevice`
--

CREATE TABLE IF NOT EXISTS `NetworkDevice` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Member` int(11) NOT NULL COMMENT 'Member',
  `Location` int(11) NOT NULL COMMENT 'Member',
  `Type` int(11) NOT NULL COMMENT 'NetworkDeviceType',
  `PositionLatitude` double NOT NULL DEFAULT '0',
  `PositionLongitude` double NOT NULL DEFAULT '0',
  `Used` int(11) NOT NULL DEFAULT '1',
  `Online` int(11) NOT NULL DEFAULT '0',
  `LastOnline` datetime NOT NULL,
  `PermanentOnline` int(11) NOT NULL,
  `InboundNATPriority` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Name` (`Name`),
  KEY `Member` (`Member`),
  KEY `Location` (`Location`),
  KEY `Type` (`Type`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=604 ;

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

--
-- Struktura tabulky `NetworkDeviceHistory`
--

CREATE TABLE IF NOT EXISTS `NetworkDeviceHistory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Device` int(11) NOT NULL DEFAULT '0',
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Action` int(11) NOT NULL DEFAULT '0',
  `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`),
  KEY `Device` (`Device`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `NetworkDeviceType`
--

CREATE TABLE IF NOT EXISTS `NetworkDeviceType` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `ShowOnline` int(11) NOT NULL DEFAULT '0',
  `IconName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=10 ;

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

--
-- Struktura tabulky `NetworkDomainAlias`
--

CREATE TABLE IF NOT EXISTS `NetworkDomainAlias` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Target` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=35 ;

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

--
-- Struktura tabulky `NetworkFirewall`
--

CREATE TABLE IF NOT EXISTS `NetworkFirewall` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `NetworkDevice` int(11) NOT NULL,
  `SourceInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
  `DestinationInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
  `SourceAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
  `DestinationAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
  `SourcePort` int(11) DEFAULT NULL,
  `DestinationPort` int(11) DEFAULT NULL,
  `Action` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `NetworkDevice` (`NetworkDevice`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;

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

--
-- Struktura tabulky `NetworkInterface`
--

CREATE TABLE IF NOT EXISTS `NetworkInterface` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Type` int(11) NOT NULL,
  `MAC` varchar(17) COLLATE utf8_czech_ci NOT NULL,
  `LocalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `IPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `ExternalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Device` int(11) NOT NULL,
  `Online` int(11) NOT NULL DEFAULT '0',
  `LastOnline` datetime NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Device` (`Device`),
  KEY `Type` (`Type`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=667 ;

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

--
-- Struktura tabulky `NetworkInterfacePortable`
--

CREATE TABLE IF NOT EXISTS `NetworkInterfacePortable` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `NetworkInterface` int(11) NOT NULL,
  `DynamicIP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Time` datetime NOT NULL,
  `Update` int(11) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `NetworkInterface` (`NetworkInterface`),
  KEY `Update` (`Update`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `NetworkInterfaceStat`
--

CREATE TABLE IF NOT EXISTS `NetworkInterfaceStat` (
  `NetworkInterface` int(11) NOT NULL DEFAULT '0',
  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `PingCount` smallint(11) NOT NULL DEFAULT '0',
  KEY `host_id` (`NetworkInterface`),
  KEY `time` (`Time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `NetworkInterfaceType`
--

CREATE TABLE IF NOT EXISTS `NetworkInterfaceType` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `MaxSpeed` int(11) NOT NULL,
  `FullDuplex` int(11) NOT NULL DEFAULT '1',
  `Color` varchar(6) COLLATE utf8_czech_ci NOT NULL DEFAULT 'ffffff',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;

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

--
-- Struktura tabulky `NetworkLink`
--

CREATE TABLE IF NOT EXISTS `NetworkLink` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Type` int(11) NOT NULL,
  `Interface1` int(11) NOT NULL,
  `Interface2` int(11) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Interface1` (`Interface1`),
  KEY `Interface2` (`Interface2`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=356 ;

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

--
-- Struktura tabulky `NetworkMangleSubgroup`
--

CREATE TABLE IF NOT EXISTS `NetworkMangleSubgroup` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `AddressRange` (`AddressRange`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=144 ;

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

--
-- Struktura tabulky `NetworkMark`
--

CREATE TABLE IF NOT EXISTS `NetworkMark` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Comment` (`Comment`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1278 ;

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

--
-- Struktura tabulky `NetworkSubnet`
--

CREATE TABLE IF NOT EXISTS `NetworkSubnet` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Mask` int(11) NOT NULL,
  `DHCP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Gateway` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `WINS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `DNS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Domain` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `NTP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Member` int(11) DEFAULT NULL,
  `ExtAddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `ExtMask` int(11) NOT NULL DEFAULT '32',
  `AddressRangeIPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Configure` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`Id`),
  KEY `Member` (`Member`),
  KEY `Configure` (`Configure`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=41 ;

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

--
-- Struktura tabulky `network_devices`
--

CREATE TABLE IF NOT EXISTS `network_devices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
  `price` int(11) NOT NULL DEFAULT '0',
  `count` int(11) NOT NULL DEFAULT '1',
  `date` date NOT NULL DEFAULT '0000-00-00',
  `segment` int(11) NOT NULL DEFAULT '0',
  `used` int(11) NOT NULL DEFAULT '0',
  `consumption` int(11) NOT NULL DEFAULT '0',
  `user` int(11) NOT NULL DEFAULT '0',
  `info` text COLLATE utf8_czech_ci NOT NULL,
  `channel` int(11) NOT NULL DEFAULT '0',
  `device_id` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `shop` varchar(64) COLLATE utf8_czech_ci NOT NULL,
  `deprecated_price` int(11) NOT NULL DEFAULT '0',
  `TimeEnlistment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TimeElimination` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `StockCard` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=162 ;

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

--
-- Struktura tabulky `network_segments`
--

CREATE TABLE IF NOT EXISTS `network_segments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
  `price` int(11) NOT NULL DEFAULT '0',
  `parent` int(11) NOT NULL DEFAULT '0',
  `users` int(11) NOT NULL DEFAULT '0',
  `consumption` int(11) NOT NULL DEFAULT '0',
  `users_overheads` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=33 ;

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

--
-- Struktura tabulky `News`
--

CREATE TABLE IF NOT EXISTS `News` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Title` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Content` text COLLATE utf8_czech_ci NOT NULL,
  `Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `TargetDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Author` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `IP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Category` int(11) DEFAULT '0',
  `Enclosure` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `User` int(11) NOT NULL DEFAULT '0',
  `Link` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `category` (`Category`),
  KEY `date` (`Date`),
  KEY `Title` (`Title`),
  KEY `Link` (`Link`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=34573 ;

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

--
-- Struktura tabulky `NewsCategory`
--

CREATE TABLE IF NOT EXISTS `NewsCategory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Permission` int(11) NOT NULL DEFAULT '0',
  `Sequence` int(11) NOT NULL,
  `Group` int(11) NOT NULL DEFAULT '1',
  `RSS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Sequence` (`Sequence`),
  KEY `Group` (`Group`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17 ;

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

--
-- Struktura tabulky `Panel`
--

CREATE TABLE IF NOT EXISTS `Panel` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Module` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Parameters` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Order` int(11) NOT NULL,
  `PanelColumn` int(11) NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `PanelColumn` (`PanelColumn`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;

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

--
-- Struktura tabulky `PanelColumn`
--

CREATE TABLE IF NOT EXISTS `PanelColumn` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Width` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;

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

--
-- Struktura tabulky `PermissionGroup`
--

CREATE TABLE IF NOT EXISTS `PermissionGroup` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;

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

--
-- Struktura tabulky `PermissionGroupAssignment`
--

CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` (
  `Group` int(11) NOT NULL DEFAULT '0',
  `GroupOrOperation` int(11) NOT NULL DEFAULT '0',
  `Type` enum('Group','Operation') COLLATE utf8_czech_ci NOT NULL DEFAULT 'Group',
  KEY `Group` (`Group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `PermissionOperation`
--

CREATE TABLE IF NOT EXISTS `PermissionOperation` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `Operation` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `Item` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `ItemId` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=44 ;

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

--
-- Struktura tabulky `PermissionUserAssignment`
--

CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` (
  `User` int(11) NOT NULL DEFAULT '0',
  `GroupOrOperation` int(11) NOT NULL DEFAULT '0',
  `Type` enum('Group','Operation') COLLATE utf8_czech_ci NOT NULL DEFAULT 'Group',
  KEY `User` (`User`),
  KEY `GroupOrOperation` (`GroupOrOperation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `PhoneBook`
--

CREATE TABLE IF NOT EXISTS `PhoneBook` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Address` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `LastUpdate` datetime NOT NULL,
  `Operator` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=53 ;

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

--
-- Struktura tabulky `Service`
--

CREATE TABLE IF NOT EXISTS `Service` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `StockCard`
--

CREATE TABLE IF NOT EXISTS `StockCard` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `SellPrice` float NOT NULL,
  `Consumption` int(11) NOT NULL COMMENT 'In Watts',
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;

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

--
-- Struktura tabulky `Subject`
--

CREATE TABLE IF NOT EXISTS `Subject` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `AddressStreet` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `AddressTown` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `AddressPSC` int(11) NOT NULL DEFAULT '0',
  `AddressCountry` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `IC` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `DIC` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `MapPositionX` float NOT NULL DEFAULT '0',
  `MapPositionY` float NOT NULL DEFAULT '0',
  `WWW` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Note` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=203 ;

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

--
-- Struktura tabulky `SubjectOpenTime`
--

CREATE TABLE IF NOT EXISTS `SubjectOpenTime` (
  `Subject` int(11) NOT NULL DEFAULT '0',
  `UpdateTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `Photo` int(11) NOT NULL,
  KEY `Subject` (`Subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `SubjectOpenTimeDay`
--

CREATE TABLE IF NOT EXISTS `SubjectOpenTimeDay` (
  `Subject` int(11) NOT NULL,
  `Day` int(11) NOT NULL,
  `Open1` int(11) NOT NULL,
  `Close1` int(11) NOT NULL,
  `Open2` int(11) NOT NULL,
  `Close2` int(11) NOT NULL,
  KEY `Subject` (`Subject`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

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

--
-- Struktura tabulky `TV`
--

CREATE TABLE IF NOT EXISTS `TV` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Frequency` int(11) NOT NULL DEFAULT '0',
  `Norm` varchar(8) COLLATE utf8_czech_ci NOT NULL,
  `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Language` varchar(32) COLLATE utf8_czech_ci NOT NULL,
  `ShortName` varchar(16) COLLATE utf8_czech_ci NOT NULL,
  `Stream` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `StreamWeb` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `SourceType` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Category` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=43 ;

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

--
-- Struktura tabulky `User`
--

CREATE TABLE IF NOT EXISTS `User` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Login` varchar(64) COLLATE utf8_czech_ci NOT NULL,
  `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
  `Password` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Email` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `LastIpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `LastLoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `Member` int(11) DEFAULT NULL,
  `Locked` tinyint(1) NOT NULL DEFAULT '0',
  `ICQ` int(11) NOT NULL DEFAULT '0',
  `PhoneNumber` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `InitPassword` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  UNIQUE KEY `Name` (`Login`),
  UNIQUE KEY `Nick` (`Name`),
  KEY `Member` (`Member`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=222 ;

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

--
-- Struktura tabulky `UserOnline`
--

CREATE TABLE IF NOT EXISTS `UserOnline` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `User` int(11) NOT NULL DEFAULT '0' COMMENT 'User.Id',
  `ActivityTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `LoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `SessionId` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `IpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `HostName` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
  `ScriptName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `User` (`User`)
) ENGINE=MEMORY  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8430 ;

--
-- Omezení pro exportované tabulky
--

--
-- Omezení pro tabulku `DocumentLineSequence`
--
ALTER TABLE `DocumentLineSequence`
  ADD CONSTRAINT `DocumentLineSequence_ibfk_1` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`),
  ADD CONSTRAINT `DocumentLineSequence_ibfk_2` FOREIGN KEY (`FinanceYear`) REFERENCES `FinanceYear` (`Id`);

--
-- Omezení pro tabulku `FinanceBills`
--
ALTER TABLE `FinanceBills`
  ADD CONSTRAINT `FinanceBills_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);

--
-- Omezení pro tabulku `FinanceBillsItems`
--
ALTER TABLE `FinanceBillsItems`
  ADD CONSTRAINT `FinanceBillsItems_ibfk_1` FOREIGN KEY (`Bill`) REFERENCES `FinanceBills` (`Id`);

--
-- Omezení pro tabulku `FinanceClaimsLiabilities`
--
ALTER TABLE `FinanceClaimsLiabilities`
  ADD CONSTRAINT `FinanceClaimsLiabilities_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);

--
-- Omezení pro tabulku `FinanceOperation`
--
ALTER TABLE `FinanceOperation`
  ADD CONSTRAINT `FinanceOperation_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
  ADD CONSTRAINT `FinanceOperation_ibfk_2` FOREIGN KEY (`Bill`) REFERENCES `FinanceBills` (`Id`);

--
-- Omezení pro tabulku `Hyperlink`
--
ALTER TABLE `Hyperlink`
  ADD CONSTRAINT `Hyperlink_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `HyperlinkGroup` (`Id`);

--
-- Omezení pro tabulku `Log`
--
ALTER TABLE `Log`
  ADD CONSTRAINT `Log_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);

--
-- Omezení pro tabulku `Member`
--
ALTER TABLE `Member`
  ADD CONSTRAINT `Member_ibfk_28` FOREIGN KEY (`BillingPeriodNext`) REFERENCES `FinanceBillingPeriod` (`Id`),
  ADD CONSTRAINT `Member_ibfk_23` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
  ADD CONSTRAINT `Member_ibfk_24` FOREIGN KEY (`ResponsibleUser`) REFERENCES `User` (`Id`),
  ADD CONSTRAINT `Member_ibfk_25` FOREIGN KEY (`InternetTariffCurrentMonth`) REFERENCES `FinanceTariff` (`Id`),
  ADD CONSTRAINT `Member_ibfk_26` FOREIGN KEY (`InternetTariffNextMonth`) REFERENCES `FinanceTariff` (`Id`),
  ADD CONSTRAINT `Member_ibfk_27` FOREIGN KEY (`BillingPeriod`) REFERENCES `FinanceBillingPeriod` (`Id`);

--
-- Omezení pro tabulku `MemberPayment`
--
ALTER TABLE `MemberPayment`
  ADD CONSTRAINT `MemberPayment_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);

--
-- Omezení pro tabulku `NetworkAP`
--
ALTER TABLE `NetworkAP`
  ADD CONSTRAINT `NetworkAP_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);

--
-- Omezení pro tabulku `NetworkDevice`
--
ALTER TABLE `NetworkDevice`
  ADD CONSTRAINT `NetworkDevice_ibfk_4` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`),
  ADD CONSTRAINT `NetworkDevice_ibfk_5` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`),
  ADD CONSTRAINT `NetworkDevice_ibfk_6` FOREIGN KEY (`Type`) REFERENCES `NetworkDeviceType` (`Id`);

--
-- Omezení pro tabulku `NetworkFirewall`
--
ALTER TABLE `NetworkFirewall`
  ADD CONSTRAINT `NetworkFirewall_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);

--
-- Omezení pro tabulku `NetworkInterface`
--
ALTER TABLE `NetworkInterface`
  ADD CONSTRAINT `NetworkInterface_ibfk_1` FOREIGN KEY (`Type`) REFERENCES `NetworkInterfaceType` (`Id`),
  ADD CONSTRAINT `NetworkInterface_ibfk_2` FOREIGN KEY (`Device`) REFERENCES `NetworkDevice` (`Id`);

--
-- Omezení pro tabulku `NetworkSubnet`
--
ALTER TABLE `NetworkSubnet`
  ADD CONSTRAINT `NetworkSubnet_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);

--
-- Omezení pro tabulku `News`
--
ALTER TABLE `News`
  ADD CONSTRAINT `News_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `NewsCategory` (`Id`);

--
-- Omezení pro tabulku `Panel`
--
ALTER TABLE `Panel`
  ADD CONSTRAINT `Panel_ibfk_1` FOREIGN KEY (`PanelColumn`) REFERENCES `PanelColumn` (`Id`);

--
-- Omezení pro tabulku `PermissionUserAssignment`
--
ALTER TABLE `PermissionUserAssignment`
  ADD CONSTRAINT `PermissionUserAssignment_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);

--
-- Omezení pro tabulku `SubjectOpenTime`
--
ALTER TABLE `SubjectOpenTime`
  ADD CONSTRAINT `SubjectOpenTime_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);

--
-- Omezení pro tabulku `SubjectOpenTimeDay`
--
ALTER TABLE `SubjectOpenTimeDay`
  ADD CONSTRAINT `SubjectOpenTimeDay_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);

--
-- Omezení pro tabulku `User`
--
ALTER TABLE `User`
  ADD CONSTRAINT `User_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);

