Changeset 479 for trunk/sql/full.sql


Ignore:
Timestamp:
Feb 5, 2013, 9:45:44 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Tabulka pro přiřazení více služeb jednomu zákazníkovi. Původní data jsou převedena do nové struktury. Tabulka Service je společná pro všechny typy služeb a pro každou službu se zobrazí nebo vyplní pouze určité použitelné sloupce.
  • Opraveno: Korekce názvů modulů na názvy začínající slovem Module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sql/full.sql

    r441 r479  
    44--
    55-- Počítač: localhost
    6 -- Vygenerováno: Sob 13. říj 2012, 18:52
     6-- Vygenerováno: Pon 07. led 2013, 23:00
    77-- Verze MySQL: 5.1.60
    88-- Verze PHP: 5.3.8
     
    1515--
    1616
     17DELIMITER $$
     18--
     19-- Funkce
     20--
     21CREATE DEFINER=`centrala`@`localhost` FUNCTION `CompareNetworkPrefix`(Address1 INT(11) UNSIGNED, Address2 INT(11) UNSIGNED, Size INT(11)) RETURNS tinyint(1)
     22RETURN Address1 & (-1 << (32 - Size)) = Address2 & (-1 << (32 - Size))$$
     23
     24DELIMITER ;
     25
     26-- --------------------------------------------------------
     27
     28--
     29-- Struktura tabulky `ChatHistory`
     30--
     31
     32CREATE TABLE IF NOT EXISTS `ChatHistory` (
     33  `Id` int(11) NOT NULL AUTO_INCREMENT,
     34  `Nick` varchar(64) COLLATE utf8_czech_ci NOT NULL,
     35  `Text` text COLLATE utf8_czech_ci NOT NULL,
     36  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     37  `Color` int(11) NOT NULL DEFAULT '0',
     38  `RoomName` varchar(32) COLLATE utf8_czech_ci NOT NULL,
     39  `RoomType` int(11) NOT NULL DEFAULT '0',
     40  `Host` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     41  PRIMARY KEY (`Id`)
     42) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=528576 ;
     43
     44-- --------------------------------------------------------
     45
     46--
     47-- Struktura tabulky `Country`
     48--
     49
     50CREATE TABLE IF NOT EXISTS `Country` (
     51  `Id` int(11) NOT NULL AUTO_INCREMENT,
     52  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     53  PRIMARY KEY (`Id`)
     54) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     55
     56-- --------------------------------------------------------
     57
     58--
     59-- Struktura tabulky `DocumentLine`
     60--
     61
     62CREATE TABLE IF NOT EXISTS `DocumentLine` (
     63  `Id` int(11) NOT NULL AUTO_INCREMENT,
     64  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     65  `Shortcut` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     66  PRIMARY KEY (`Id`),
     67  UNIQUE KEY `Shortcut` (`Shortcut`)
     68) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=9 ;
     69
     70-- --------------------------------------------------------
     71
     72--
     73-- Struktura tabulky `DocumentLineSequence`
     74--
     75
     76CREATE TABLE IF NOT EXISTS `DocumentLineSequence` (
     77  `Id` int(11) NOT NULL AUTO_INCREMENT,
     78  `DocumentLine` int(11) NOT NULL,
     79  `FinanceYear` int(11) NOT NULL,
     80  `NextNumber` int(11) NOT NULL,
     81  `YearPrefix` int(11) NOT NULL,
     82  PRIMARY KEY (`Id`),
     83  KEY `DocumentLine` (`DocumentLine`),
     84  KEY `FinanceYear` (`FinanceYear`)
     85) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=35 ;
     86
     87--
     88-- RELACE PRO TABULKU `DocumentLineSequence`:
     89--   `DocumentLine`
     90--       `DocumentLine` -> `Id`
     91--   `FinanceYear`
     92--       `FinanceYear` -> `Id`
     93--
     94
     95-- --------------------------------------------------------
     96
     97--
     98-- Struktura tabulky `EmailQueue`
     99--
     100
     101CREATE TABLE IF NOT EXISTS `EmailQueue` (
     102  `Id` int(11) NOT NULL AUTO_INCREMENT,
     103  `Time` datetime NOT NULL,
     104  `To` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     105  `Subject` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     106  `Content` text COLLATE utf8_czech_ci NOT NULL,
     107  `Headers` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     108  `Archive` int(11) NOT NULL DEFAULT '0',
     109  `From` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     110  `AttachmentFile` int(11) DEFAULT NULL,
     111  PRIMARY KEY (`Id`),
     112  KEY `Archive` (`Archive`)
     113) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3052 ;
     114
     115-- --------------------------------------------------------
     116
     117--
     118-- Struktura tabulky `File`
     119--
     120
     121CREATE TABLE IF NOT EXISTS `File` (
     122  `Id` int(11) NOT NULL AUTO_INCREMENT,
     123  `Name` varchar(256) COLLATE utf8_czech_ci NOT NULL,
     124  `Size` int(11) NOT NULL,
     125  PRIMARY KEY (`Id`)
     126) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     127
     128-- --------------------------------------------------------
     129
     130--
     131-- Struktura tabulky `FinanceAssetsHistory`
     132--
     133
     134CREATE TABLE IF NOT EXISTS `FinanceAssetsHistory` (
     135  `AssetsId` int(11) NOT NULL DEFAULT '0',
     136  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     137  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     138  `User` int(11) NOT NULL DEFAULT '0',
     139  KEY `AssetsId` (`AssetsId`)
     140) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     141
     142-- --------------------------------------------------------
     143
     144--
     145-- Struktura tabulky `FinanceBankAccount`
     146--
     147
     148CREATE TABLE IF NOT EXISTS `FinanceBankAccount` (
     149  `Id` int(11) NOT NULL AUTO_INCREMENT,
     150  `TimeCreate` date NOT NULL,
     151  `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     152  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     153  PRIMARY KEY (`Id`)
     154) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     155
     156-- --------------------------------------------------------
     157
     158--
     159-- Struktura tabulky `FinanceBillingPeriod`
     160--
     161
     162CREATE TABLE IF NOT EXISTS `FinanceBillingPeriod` (
     163  `Id` int(11) NOT NULL AUTO_INCREMENT,
     164  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     165  `MonthCount` int(11) NOT NULL,
     166  PRIMARY KEY (`Id`)
     167) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;
     168
     169-- --------------------------------------------------------
     170
     171--
     172-- Struktura tabulky `FinanceBills`
     173--
     174
     175CREATE TABLE IF NOT EXISTS `FinanceBills` (
     176  `Id` int(11) NOT NULL AUTO_INCREMENT,
     177  `TimeFrom` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     178  `Subject` int(11) NOT NULL DEFAULT '0',
     179  `TimeTo` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     180  `TimeCreate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     181  `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     182  `BillCode` varchar(32) COLLATE utf8_czech_ci NOT NULL,
     183  `Type` enum('invoice','income') COLLATE utf8_czech_ci NOT NULL,
     184  `Cash` int(11) NOT NULL DEFAULT '0',
     185  PRIMARY KEY (`Id`),
     186  KEY `Subject` (`Subject`),
     187  KEY `Subject_2` (`Subject`)
     188) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6204 ;
     189
     190--
     191-- RELACE PRO TABULKU `FinanceBills`:
     192--   `Subject`
     193--       `Subject` -> `Id`
     194--
     195
     196-- --------------------------------------------------------
     197
     198--
     199-- Struktura tabulky `FinanceBillsItems`
     200--
     201
     202CREATE TABLE IF NOT EXISTS `FinanceBillsItems` (
     203  `Id` int(11) NOT NULL AUTO_INCREMENT,
     204  `Bill` int(11) NOT NULL DEFAULT '0',
     205  `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     206  `Price` float NOT NULL DEFAULT '0',
     207  `Quantity` float NOT NULL DEFAULT '1',
     208  PRIMARY KEY (`Id`),
     209  KEY `Bill` (`Bill`)
     210) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17745 ;
     211
     212--
     213-- RELACE PRO TABULKU `FinanceBillsItems`:
     214--   `Bill`
     215--       `FinanceBills` -> `Id`
     216--
     217
     218-- --------------------------------------------------------
     219
     220--
     221-- Struktura tabulky `FinanceCharge`
     222--
     223
     224CREATE TABLE IF NOT EXISTS `FinanceCharge` (
     225  `Period` int(11) NOT NULL DEFAULT '0',
     226  `Internet` int(11) NOT NULL DEFAULT '0',
     227  `InternetSpeed` int(11) NOT NULL DEFAULT '0',
     228  `InternetSpeedReserve` int(11) NOT NULL DEFAULT '0',
     229  `AdministrationPerUser` int(20) NOT NULL DEFAULT '0',
     230  `kWh` int(11) NOT NULL DEFAULT '0',
     231  `BaseSpeedElement` int(11) NOT NULL DEFAULT '0',
     232  `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
     233  `TopTariffPrice` int(11) NOT NULL DEFAULT '0'
     234) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     235
     236-- --------------------------------------------------------
     237
     238--
     239-- Struktura tabulky `FinanceClaimsLiabilities`
     240--
     241
     242CREATE TABLE IF NOT EXISTS `FinanceClaimsLiabilities` (
     243  `Id` int(11) NOT NULL AUTO_INCREMENT,
     244  `BillCode` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     245  `Subject` int(11) NOT NULL DEFAULT '0',
     246  `TimeCreation` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     247  `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     248  `TimePayment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     249  `Value` float NOT NULL DEFAULT '0',
     250  `Bill` int(11) DEFAULT '0',
     251  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     252  PRIMARY KEY (`Id`),
     253  KEY `Subject` (`Subject`),
     254  KEY `Bill` (`Bill`)
     255) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8670 ;
     256
     257--
     258-- RELACE PRO TABULKU `FinanceClaimsLiabilities`:
     259--   `Subject`
     260--       `Subject` -> `Id`
     261--
     262
     263-- --------------------------------------------------------
     264
     265--
     266-- Struktura tabulky `FinanceGroup`
     267--
     268
     269CREATE TABLE IF NOT EXISTS `FinanceGroup` (
     270  `Id` int(11) NOT NULL AUTO_INCREMENT,
     271  `Description` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     272  PRIMARY KEY (`Id`)
     273) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     274
     275-- --------------------------------------------------------
     276
     277--
     278-- Struktura tabulky `FinanceLog`
     279--
     280
     281CREATE TABLE IF NOT EXISTS `FinanceLog` (
     282  `Id` int(11) NOT NULL AUTO_INCREMENT,
     283  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     284  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     285  PRIMARY KEY (`Id`)
     286) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     287
     288-- --------------------------------------------------------
     289
     290--
     291-- Struktura tabulky `FinanceMonthlyOverall`
     292--
     293
     294CREATE TABLE IF NOT EXISTS `FinanceMonthlyOverall` (
     295  `Id` int(11) NOT NULL AUTO_INCREMENT,
     296  `Money` int(11) NOT NULL DEFAULT '0',
     297  `Date` date NOT NULL DEFAULT '0000-00-00',
     298  `Administration` int(11) NOT NULL DEFAULT '0',
     299  `kWh` int(11) NOT NULL DEFAULT '0',
     300  `AdministrationTotal` int(11) NOT NULL DEFAULT '0',
     301  `ConsumptionTotal` int(11) NOT NULL DEFAULT '0',
     302  `TotalPaid` int(11) NOT NULL DEFAULT '0',
     303  `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
     304  `TopTariffPrice` int(11) NOT NULL DEFAULT '0',
     305  `MemberCount` int(11) NOT NULL DEFAULT '0',
     306  `Investment` int(11) NOT NULL,
     307  PRIMARY KEY (`Id`)
     308) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=121 ;
     309
     310-- --------------------------------------------------------
     311
     312--
     313-- Struktura tabulky `FinanceOperation`
     314--
     315
     316CREATE TABLE IF NOT EXISTS `FinanceOperation` (
     317  `Id` int(11) NOT NULL AUTO_INCREMENT,
     318  `Time` datetime NOT NULL,
     319  `Subject` int(11) NOT NULL DEFAULT '0',
     320  `Cash` int(11) NOT NULL DEFAULT '0',
     321  `Value` float NOT NULL,
     322  `BillCode` varchar(32) COLLATE utf8_czech_ci DEFAULT NULL,
     323  `Taxable` tinyint(1) NOT NULL DEFAULT '1',
     324  `Bill` int(11) DEFAULT NULL,
     325  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT 'Vklad',
     326  `Network` int(11) NOT NULL DEFAULT '1',
     327  `BankAccount` int(11) DEFAULT NULL COMMENT 'FinanceBankAccount',
     328  `Treasury` int(11) DEFAULT NULL COMMENT 'FinanceTreasury',
     329  PRIMARY KEY (`Id`),
     330  UNIQUE KEY `BillCode` (`BillCode`),
     331  UNIQUE KEY `BillCode_2` (`BillCode`),
     332  KEY `Subject` (`Subject`),
     333  KEY `Bill` (`Bill`),
     334  KEY `BankAccount` (`BankAccount`),
     335  KEY `Treasury` (`Treasury`)
     336) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6487 ;
     337
     338--
     339-- RELACE PRO TABULKU `FinanceOperation`:
     340--   `Subject`
     341--       `Subject` -> `Id`
     342--   `Bill`
     343--       `FinanceBills` -> `Id`
     344--   `BankAccount`
     345--       `FinanceBankAccount` -> `Id`
     346--   `Treasury`
     347--       `FinanceTreasury` -> `Id`
     348--
     349
     350-- --------------------------------------------------------
     351
     352--
     353-- Struktura tabulky `FinanceSmallAssets`
     354--
     355
     356CREATE TABLE IF NOT EXISTS `FinanceSmallAssets` (
     357  `Id` int(11) NOT NULL AUTO_INCREMENT,
     358  `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     359  `PricePurchase` float NOT NULL DEFAULT '0',
     360  `TimeEnlistment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     361  `TimeElimination` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     362  `SupplySubject` int(11) NOT NULL DEFAULT '0',
     363  `DeviceId` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     364  PRIMARY KEY (`Id`)
     365) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     366
     367-- --------------------------------------------------------
     368
     369--
     370-- Struktura tabulky `FinanceTariff`
     371--
     372
     373CREATE TABLE IF NOT EXISTS `FinanceTariff` (
     374  `Id` int(11) NOT NULL AUTO_INCREMENT,
     375  `Name` varchar(32) COLLATE utf8_czech_ci NOT NULL,
     376  `Group` int(11) NOT NULL DEFAULT '0',
     377  `SpeedMin` int(11) NOT NULL DEFAULT '0',
     378  `SpeedMax` int(11) NOT NULL DEFAULT '0',
     379  `UploadAsymmetry` int(11) NOT NULL DEFAULT '1',
     380  `Price` int(11) NOT NULL DEFAULT '0',
     381  `MemberCount` int(11) NOT NULL DEFAULT '0',
     382  `ReplaceId` int(11) DEFAULT NULL,
     383  `Public` int(11) NOT NULL DEFAULT '1',
     384  PRIMARY KEY (`Id`),
     385  KEY `ReplaceId` (`ReplaceId`),
     386  KEY `Public` (`Public`)
     387) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16 ;
     388
     389-- --------------------------------------------------------
     390
     391--
     392-- Struktura tabulky `FinanceTreasury`
     393--
     394
     395CREATE TABLE IF NOT EXISTS `FinanceTreasury` (
     396  `Id` int(11) NOT NULL AUTO_INCREMENT,
     397  `TimeCreate` date NOT NULL,
     398  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     399  PRIMARY KEY (`Id`)
     400) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2 ;
     401
     402-- --------------------------------------------------------
     403
     404--
     405-- Struktura tabulky `FinanceYear`
     406--
     407
     408CREATE TABLE IF NOT EXISTS `FinanceYear` (
     409  `Id` int(11) NOT NULL AUTO_INCREMENT,
     410  `Year` int(11) NOT NULL,
     411  `DateStart` date NOT NULL,
     412  `DateEnd` date NOT NULL,
     413  PRIMARY KEY (`Id`)
     414) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=9 ;
     415
     416-- --------------------------------------------------------
     417
     418--
     419-- Struktura tabulky `HostedProject`
     420--
     421
     422CREATE TABLE IF NOT EXISTS `HostedProject` (
     423  `Id` int(11) NOT NULL AUTO_INCREMENT,
     424  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     425  `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     426  `User` int(255) NOT NULL COMMENT 'User.Id',
     427  `TimeCreate` datetime NOT NULL,
     428  `Server` int(11) DEFAULT NULL COMMENT 'NetworkDevice.Id',
     429  `Active` int(11) NOT NULL DEFAULT '1',
     430  `WebHosting` int(11) NOT NULL,
     431  PRIMARY KEY (`Id`)
     432) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16 ;
     433
     434-- --------------------------------------------------------
     435
     436--
     437-- Struktura tabulky `Hyperlink`
     438--
     439
     440CREATE TABLE IF NOT EXISTS `Hyperlink` (
     441  `Id` int(11) NOT NULL AUTO_INCREMENT,
     442  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     443  `URL` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     444  `Group` int(11) NOT NULL,
     445  `IconFile` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     446  `PermissionModule` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     447  `PermissionOperation` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     448  `Enable` int(11) NOT NULL DEFAULT '1',
     449  PRIMARY KEY (`Id`),
     450  KEY `Group` (`Group`),
     451  KEY `Enable` (`Enable`)
     452) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=68 ;
     453
     454--
     455-- RELACE PRO TABULKU `Hyperlink`:
     456--   `Group`
     457--       `HyperlinkGroup` -> `Id`
     458--
     459
     460-- --------------------------------------------------------
     461
     462--
     463-- Struktura tabulky `HyperlinkGroup`
     464--
     465
     466CREATE TABLE IF NOT EXISTS `HyperlinkGroup` (
     467  `Id` int(11) NOT NULL AUTO_INCREMENT,
     468  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     469  PRIMARY KEY (`Id`)
     470) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=10 ;
     471
     472-- --------------------------------------------------------
     473
     474--
     475-- Struktura tabulky `ISMenuItem`
     476--
     477
     478CREATE TABLE IF NOT EXISTS `ISMenuItem` (
     479  `Id` int(11) NOT NULL AUTO_INCREMENT,
     480  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     481  `Parent` int(11) DEFAULT NULL,
     482  `Table` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     483  `IconName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     484  PRIMARY KEY (`Id`),
     485  KEY `Parent` (`Parent`)
     486) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=38 ;
     487
     488--
     489-- RELACE PRO TABULKU `ISMenuItem`:
     490--   `Parent`
     491--       `ISMenuItem` -> `Id`
     492--
     493
     494-- --------------------------------------------------------
     495
     496--
     497-- Struktura tabulky `Language`
     498--
     499
     500CREATE TABLE IF NOT EXISTS `Language` (
     501  `Id` int(11) NOT NULL AUTO_INCREMENT,
     502  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     503  PRIMARY KEY (`Id`)
     504) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;
     505
    17506-- --------------------------------------------------------
    18507
     
    22511
    23512CREATE TABLE IF NOT EXISTS `Log` (
     513  `Id` int(11) NOT NULL AUTO_INCREMENT,
    24514  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    25515  `User` int(11) NOT NULL DEFAULT '0',
     
    27517  `Operation` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
    28518  `Value` text COLLATE utf8_czech_ci NOT NULL,
     519  PRIMARY KEY (`Id`),
    29520  KEY `Time` (`Time`),
    30521  KEY `User` (`User`)
    31 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     522) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=37799 ;
    32523
    33524--
     
    37528--
    38529
     530-- --------------------------------------------------------
     531
     532--
     533-- Struktura tabulky `Meals`
     534--
     535
     536CREATE TABLE IF NOT EXISTS `Meals` (
     537  `Date` date NOT NULL DEFAULT '0000-00-00',
     538  `Soup` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     539  `Meal` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     540  `Status` int(11) NOT NULL DEFAULT '0',
     541  UNIQUE KEY `date` (`Date`)
     542) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
     543
     544-- --------------------------------------------------------
     545
     546--
     547-- Struktura tabulky `MealsInfo`
     548--
     549
     550CREATE TABLE IF NOT EXISTS `MealsInfo` (
     551  `Info` text COLLATE utf8_czech_ci NOT NULL,
     552  `Price` int(11) NOT NULL DEFAULT '0'
     553) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
     554
     555-- --------------------------------------------------------
     556
     557--
     558-- Struktura tabulky `Member`
     559--
     560
     561CREATE TABLE IF NOT EXISTS `Member` (
     562  `Id` int(11) NOT NULL AUTO_INCREMENT,
     563  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     564  `Subject` int(11) NOT NULL,
     565  `ResponsibleUser` int(11) NOT NULL,
     566  `FamilyMemberCount` int(11) NOT NULL,
     567  `MembershipDate` date NOT NULL,
     568  `MemberState` int(11) NOT NULL,
     569  `InternetTariffCurrentMonth` int(11) NOT NULL,
     570  `InternetTariffNextMonth` int(11) NOT NULL,
     571  `GPS` int(11) NOT NULL,
     572  `BillingPeriod` int(11) NOT NULL DEFAULT '2',
     573  `NetworkSegment` int(11) DEFAULT NULL,
     574  `BillingPeriodNext` int(11) NOT NULL DEFAULT '2',
     575  `BillingPeriodLastDate` date NOT NULL,
     576  `Hire` float NOT NULL DEFAULT '0',
     577  `Blocked` int(11) NOT NULL DEFAULT '0',
     578  `PayDay` int(11) NOT NULL DEFAULT '1',
     579  PRIMARY KEY (`Id`),
     580  KEY `Subject` (`Subject`),
     581  KEY `ResponsibleUser` (`ResponsibleUser`),
     582  KEY `InternetTariffCurrentMonth` (`InternetTariffCurrentMonth`),
     583  KEY `InternetTariffNextMonth` (`InternetTariffNextMonth`),
     584  KEY `BillingPeriod` (`BillingPeriod`),
     585  KEY `BillingPeriodNext` (`BillingPeriodNext`),
     586  KEY `NetworkSegment` (`NetworkSegment`)
     587) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=199 ;
     588
     589--
     590-- RELACE PRO TABULKU `Member`:
     591--   `Subject`
     592--       `Subject` -> `Id`
     593--   `ResponsibleUser`
     594--       `User` -> `Id`
     595--   `InternetTariffCurrentMonth`
     596--       `FinanceTariff` -> `Id`
     597--   `InternetTariffNextMonth`
     598--       `FinanceTariff` -> `Id`
     599--   `BillingPeriod`
     600--       `FinanceBillingPeriod` -> `Id`
     601--   `BillingPeriodNext`
     602--       `FinanceBillingPeriod` -> `Id`
     603--
     604
     605-- --------------------------------------------------------
     606
     607--
     608-- Struktura tabulky `MemberPayment`
     609--
     610
     611CREATE TABLE IF NOT EXISTS `MemberPayment` (
     612  `Id` int(11) NOT NULL AUTO_INCREMENT,
     613  `Member` int(11) NOT NULL,
     614  `MonthlyTotal` float NOT NULL,
     615  `MonthlyInternet` float NOT NULL,
     616  `MonthlyConsumption` float NOT NULL,
     617  `NetworkDevice` float NOT NULL,
     618  `MonthlyPlus` float NOT NULL,
     619  `Cash` float NOT NULL,
     620  PRIMARY KEY (`Id`),
     621  KEY `Member` (`Member`)
     622) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=181 ;
     623
     624--
     625-- RELACE PRO TABULKU `MemberPayment`:
     626--   `Member`
     627--       `Member` -> `Id`
     628--
     629
     630-- --------------------------------------------------------
     631
     632--
     633-- Struktura tabulky `NetworkAP`
     634--
     635
     636CREATE TABLE IF NOT EXISTS `NetworkAP` (
     637  `Id` int(11) NOT NULL AUTO_INCREMENT,
     638  `SSID` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     639  `Frequency` int(11) NOT NULL,
     640  `ChannelWidth` int(11) NOT NULL DEFAULT '20',
     641  `NetworkDevice` int(11) DEFAULT NULL,
     642  PRIMARY KEY (`Id`),
     643  KEY `NetworkDevice` (`NetworkDevice`)
     644) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=45 ;
     645
     646--
     647-- RELACE PRO TABULKU `NetworkAP`:
     648--   `NetworkDevice`
     649--       `NetworkDevice` -> `Id`
     650--
     651
     652-- --------------------------------------------------------
     653
     654--
     655-- Struktura tabulky `NetworkConfiguration`
     656--
     657
     658CREATE TABLE IF NOT EXISTS `NetworkConfiguration` (
     659  `Id` int(11) NOT NULL AUTO_INCREMENT,
     660  `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     661  `Execute` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     662  `Changed` int(11) NOT NULL DEFAULT '0',
     663  `LastTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     664  `ExecutionTime` int(11) NOT NULL,
     665  `Enabled` int(11) NOT NULL DEFAULT '1',
     666  `Period` int(11) NOT NULL DEFAULT '60',
     667  `Log` mediumtext COLLATE utf8_czech_ci NOT NULL,
     668  PRIMARY KEY (`Id`)
     669) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;
     670
     671-- --------------------------------------------------------
     672
     673--
     674-- Struktura tabulky `NetworkDevice`
     675--
     676
     677CREATE TABLE IF NOT EXISTS `NetworkDevice` (
     678  `Id` int(11) NOT NULL AUTO_INCREMENT,
     679  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     680  `Member` int(11) NOT NULL COMMENT 'Member',
     681  `Location` int(11) NOT NULL COMMENT 'Member',
     682  `Type` int(11) NOT NULL COMMENT 'NetworkDeviceType',
     683  `PositionLatitude` double NOT NULL DEFAULT '0',
     684  `PositionLongitude` double NOT NULL DEFAULT '0',
     685  `Used` int(11) NOT NULL DEFAULT '1',
     686  `Online` int(11) NOT NULL DEFAULT '0',
     687  `LastOnline` datetime NOT NULL,
     688  `PermanentOnline` int(11) NOT NULL DEFAULT '0',
     689  `InboundNATPriority` int(11) NOT NULL DEFAULT '1',
     690  PRIMARY KEY (`Id`),
     691  UNIQUE KEY `Name` (`Name`),
     692  KEY `Member` (`Member`),
     693  KEY `Location` (`Location`),
     694  KEY `Type` (`Type`)
     695) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=639 ;
     696
     697--
     698-- RELACE PRO TABULKU `NetworkDevice`:
     699--   `Member`
     700--       `Member` -> `Id`
     701--   `Location`
     702--       `Member` -> `Id`
     703--   `Type`
     704--       `NetworkDeviceType` -> `Id`
     705--
     706
     707-- --------------------------------------------------------
     708
     709--
     710-- Struktura tabulky `NetworkDeviceConfig`
     711--
     712
     713CREATE TABLE IF NOT EXISTS `NetworkDeviceConfig` (
     714  `Id` int(11) NOT NULL AUTO_INCREMENT,
     715  `Device` int(11) NOT NULL,
     716  `Time` date NOT NULL,
     717  `ConfigFull` mediumtext NOT NULL,
     718  `ConfigCompact` mediumtext NOT NULL,
     719  PRIMARY KEY (`Id`),
     720  KEY `Time` (`Time`),
     721  KEY `Device` (`Device`)
     722) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     723
     724--
     725-- RELACE PRO TABULKU `NetworkDeviceConfig`:
     726--   `Device`
     727--       `NetworkDevice` -> `Id`
     728--
     729
     730-- --------------------------------------------------------
     731
     732--
     733-- Struktura tabulky `NetworkDeviceHistory`
     734--
     735
     736CREATE TABLE IF NOT EXISTS `NetworkDeviceHistory` (
     737  `Id` int(11) NOT NULL AUTO_INCREMENT,
     738  `Device` int(11) NOT NULL DEFAULT '0',
     739  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     740  `Action` int(11) NOT NULL DEFAULT '0',
     741  `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     742  PRIMARY KEY (`Id`),
     743  KEY `Device` (`Device`)
     744) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     745
     746-- --------------------------------------------------------
     747
     748--
     749-- Struktura tabulky `NetworkDeviceType`
     750--
     751
     752CREATE TABLE IF NOT EXISTS `NetworkDeviceType` (
     753  `Id` int(11) NOT NULL AUTO_INCREMENT,
     754  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     755  `ShowOnline` int(11) NOT NULL DEFAULT '0',
     756  `IconName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     757  PRIMARY KEY (`Id`)
     758) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
     759
     760-- --------------------------------------------------------
     761
     762--
     763-- Struktura tabulky `NetworkDomainAlias`
     764--
     765
     766CREATE TABLE IF NOT EXISTS `NetworkDomainAlias` (
     767  `Id` int(11) NOT NULL AUTO_INCREMENT,
     768  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     769  `Target` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     770  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     771  PRIMARY KEY (`Id`),
     772  UNIQUE KEY `Name` (`Name`,`Target`),
     773  UNIQUE KEY `Name_2` (`Name`,`Target`)
     774) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=40 ;
     775
     776-- --------------------------------------------------------
     777
     778--
     779-- Struktura tabulky `NetworkFirewall`
     780--
     781
     782CREATE TABLE IF NOT EXISTS `NetworkFirewall` (
     783  `Id` int(11) NOT NULL AUTO_INCREMENT,
     784  `NetworkDevice` int(11) NOT NULL,
     785  `SourceInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     786  `DestinationInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     787  `SourceAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     788  `DestinationAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     789  `SourcePort` int(11) DEFAULT NULL,
     790  `DestinationPort` int(11) DEFAULT NULL,
     791  `Action` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     792  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     793  PRIMARY KEY (`Id`),
     794  KEY `NetworkDevice` (`NetworkDevice`)
     795) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;
     796
     797--
     798-- RELACE PRO TABULKU `NetworkFirewall`:
     799--   `NetworkDevice`
     800--       `NetworkDevice` -> `Id`
     801--
     802
     803-- --------------------------------------------------------
     804
     805--
     806-- Struktura tabulky `NetworkInterface`
     807--
     808
     809CREATE TABLE IF NOT EXISTS `NetworkInterface` (
     810  `Id` int(11) NOT NULL AUTO_INCREMENT,
     811  `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     812  `Type` int(11) NOT NULL,
     813  `MAC` varchar(17) COLLATE utf8_czech_ci NOT NULL,
     814  `LocalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     815  `IPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     816  `ExternalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     817  `Device` int(11) NOT NULL,
     818  `Online` int(11) NOT NULL DEFAULT '0',
     819  `LastOnline` datetime NOT NULL,
     820  PRIMARY KEY (`Id`),
     821  KEY `Device` (`Device`),
     822  KEY `Type` (`Type`)
     823) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=705 ;
     824
     825--
     826-- RELACE PRO TABULKU `NetworkInterface`:
     827--   `Type`
     828--       `NetworkInterfaceType` -> `Id`
     829--   `Device`
     830--       `NetworkDevice` -> `Id`
     831--
     832
     833-- --------------------------------------------------------
     834
     835--
     836-- Struktura tabulky `NetworkInterfacePortable`
     837--
     838
     839CREATE TABLE IF NOT EXISTS `NetworkInterfacePortable` (
     840  `Id` int(11) NOT NULL AUTO_INCREMENT,
     841  `NetworkInterface` int(11) NOT NULL,
     842  `DynamicIP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     843  `Time` datetime NOT NULL,
     844  `Update` int(11) NOT NULL,
     845  PRIMARY KEY (`Id`),
     846  KEY `NetworkInterface` (`NetworkInterface`),
     847  KEY `Update` (`Update`)
     848) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     849
     850-- --------------------------------------------------------
     851
     852--
     853-- Struktura tabulky `NetworkInterfaceStat`
     854--
     855
     856CREATE TABLE IF NOT EXISTS `NetworkInterfaceStat` (
     857  `NetworkInterface` int(11) NOT NULL DEFAULT '0',
     858  `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     859  `PingCount` smallint(11) NOT NULL DEFAULT '0',
     860  KEY `host_id` (`NetworkInterface`),
     861  KEY `time` (`Time`)
     862) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     863
     864-- --------------------------------------------------------
     865
     866--
     867-- Struktura tabulky `NetworkInterfaceType`
     868--
     869
     870CREATE TABLE IF NOT EXISTS `NetworkInterfaceType` (
     871  `Id` int(11) NOT NULL AUTO_INCREMENT,
     872  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     873  `MaxSpeed` int(11) NOT NULL,
     874  `FullDuplex` int(11) NOT NULL DEFAULT '1',
     875  `Color` varchar(6) COLLATE utf8_czech_ci NOT NULL DEFAULT 'ffffff',
     876  PRIMARY KEY (`Id`)
     877) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;
     878
     879-- --------------------------------------------------------
     880
     881--
     882-- Struktura tabulky `NetworkLink`
     883--
     884
     885CREATE TABLE IF NOT EXISTS `NetworkLink` (
     886  `Id` int(11) NOT NULL AUTO_INCREMENT,
     887  `Type` int(11) NOT NULL,
     888  `Interface1` int(11) NOT NULL,
     889  `Interface2` int(11) NOT NULL,
     890  PRIMARY KEY (`Id`),
     891  KEY `Interface1` (`Interface1`),
     892  KEY `Interface2` (`Interface2`)
     893) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=356 ;
     894
     895-- --------------------------------------------------------
     896
     897--
     898-- Struktura tabulky `NetworkMangleSubgroup`
     899--
     900
     901CREATE TABLE IF NOT EXISTS `NetworkMangleSubgroup` (
     902  `Id` int(11) NOT NULL AUTO_INCREMENT,
     903  `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     904  PRIMARY KEY (`Id`),
     905  KEY `AddressRange` (`AddressRange`)
     906) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=147 ;
     907
     908-- --------------------------------------------------------
     909
     910--
     911-- Struktura tabulky `NetworkMark`
     912--
     913
     914CREATE TABLE IF NOT EXISTS `NetworkMark` (
     915  `Id` int(11) NOT NULL AUTO_INCREMENT,
     916  `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     917  PRIMARY KEY (`Id`),
     918  KEY `Comment` (`Comment`)
     919) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1404 ;
     920
     921-- --------------------------------------------------------
     922
     923--
     924-- Struktura tabulky `NetworkSegment`
     925--
     926
     927CREATE TABLE IF NOT EXISTS `NetworkSegment` (
     928  `Id` int(11) NOT NULL AUTO_INCREMENT,
     929  `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
     930  `Price` int(11) NOT NULL DEFAULT '0',
     931  `Parent` int(11) DEFAULT '0',
     932  `Users` int(11) NOT NULL DEFAULT '0',
     933  `Consumption` int(11) NOT NULL DEFAULT '0',
     934  `UsersOverheads` int(11) NOT NULL DEFAULT '0',
     935  PRIMARY KEY (`Id`),
     936  KEY `Parent` (`Parent`)
     937) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=33 ;
     938
     939--
     940-- RELACE PRO TABULKU `NetworkSegment`:
     941--   `Parent`
     942--       `NetworkSegment` -> `Id`
     943--
     944
     945-- --------------------------------------------------------
     946
     947--
     948-- Struktura tabulky `NetworkSubnet`
     949--
     950
     951CREATE TABLE IF NOT EXISTS `NetworkSubnet` (
     952  `Id` int(11) NOT NULL AUTO_INCREMENT,
     953  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     954  `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     955  `Mask` int(11) NOT NULL,
     956  `DHCP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     957  `Gateway` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     958  `WINS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     959  `DNS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     960  `Domain` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     961  `NTP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     962  `Member` int(11) DEFAULT NULL,
     963  `ExtAddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     964  `ExtMask` int(11) NOT NULL DEFAULT '32',
     965  `AddressRangeIPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     966  `Configure` int(11) NOT NULL DEFAULT '1',
     967  PRIMARY KEY (`Id`),
     968  KEY `Member` (`Member`),
     969  KEY `Configure` (`Configure`)
     970) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=44 ;
     971
     972--
     973-- RELACE PRO TABULKU `NetworkSubnet`:
     974--   `Member`
     975--       `Member` -> `Id`
     976--
     977
     978-- --------------------------------------------------------
     979
     980--
     981-- Struktura tabulky `NetworkTopology`
     982--
     983
     984CREATE TABLE IF NOT EXISTS `NetworkTopology` (
     985  `Host` int(11) NOT NULL DEFAULT '0',
     986  `Depth` int(11) NOT NULL DEFAULT '0',
     987  `Pos` int(11) NOT NULL DEFAULT '0',
     988  `First` int(11) NOT NULL DEFAULT '0',
     989  `Last` int(11) NOT NULL DEFAULT '0',
     990  PRIMARY KEY (`Host`)
     991) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     992
     993-- --------------------------------------------------------
     994
     995--
     996-- Struktura tabulky `News`
     997--
     998
     999CREATE TABLE IF NOT EXISTS `News` (
     1000  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1001  `Title` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1002  `Content` text COLLATE utf8_czech_ci NOT NULL,
     1003  `Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1004  `TargetDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1005  `Author` varchar(32) COLLATE utf8_czech_ci NOT NULL,
     1006  `IP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     1007  `Category` int(11) DEFAULT '0',
     1008  `Enclosure` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1009  `User` int(11) DEFAULT NULL,
     1010  `Link` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1011  PRIMARY KEY (`Id`),
     1012  KEY `category` (`Category`),
     1013  KEY `date` (`Date`),
     1014  KEY `Title` (`Title`),
     1015  KEY `Link` (`Link`),
     1016  KEY `User` (`User`)
     1017) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=973267 ;
     1018
     1019--
     1020-- RELACE PRO TABULKU `News`:
     1021--   `Category`
     1022--       `NewsCategory` -> `Id`
     1023--   `User`
     1024--       `User` -> `Id`
     1025--
     1026
     1027-- --------------------------------------------------------
     1028
     1029--
     1030-- Struktura tabulky `NewsCategory`
     1031--
     1032
     1033CREATE TABLE IF NOT EXISTS `NewsCategory` (
     1034  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1035  `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1036  `Permission` int(11) NOT NULL DEFAULT '0',
     1037  `Sequence` int(11) NOT NULL,
     1038  `Group` int(11) NOT NULL DEFAULT '1',
     1039  `RSS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1040  PRIMARY KEY (`Id`),
     1041  KEY `Sequence` (`Sequence`),
     1042  KEY `Group` (`Group`)
     1043) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17 ;
     1044
     1045-- --------------------------------------------------------
     1046
     1047--
     1048-- Struktura tabulky `Panel`
     1049--
     1050
     1051CREATE TABLE IF NOT EXISTS `Panel` (
     1052  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1053  `Module` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1054  `Parameters` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1055  `Order` int(11) NOT NULL,
     1056  `PanelColumn` int(11) NOT NULL,
     1057  PRIMARY KEY (`Id`),
     1058  KEY `PanelColumn` (`PanelColumn`)
     1059) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;
     1060
     1061--
     1062-- RELACE PRO TABULKU `Panel`:
     1063--   `PanelColumn`
     1064--       `PanelColumn` -> `Id`
     1065--
     1066
     1067-- --------------------------------------------------------
     1068
     1069--
     1070-- Struktura tabulky `PanelColumn`
     1071--
     1072
     1073CREATE TABLE IF NOT EXISTS `PanelColumn` (
     1074  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1075  `Width` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1076  PRIMARY KEY (`Id`)
     1077) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     1078
     1079-- --------------------------------------------------------
     1080
     1081--
     1082-- Struktura tabulky `PermissionGroup`
     1083--
     1084
     1085CREATE TABLE IF NOT EXISTS `PermissionGroup` (
     1086  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1087  `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1088  PRIMARY KEY (`Id`)
     1089) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;
     1090
     1091-- --------------------------------------------------------
     1092
     1093--
     1094-- Struktura tabulky `PermissionGroupAssignment`
     1095--
     1096
     1097CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` (
     1098  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1099  `Group` int(11) NOT NULL DEFAULT '0',
     1100  `AssignedGroup` int(11) DEFAULT NULL,
     1101  `AssignedOperation` int(11) DEFAULT NULL,
     1102  PRIMARY KEY (`Id`),
     1103  KEY `Group` (`Group`),
     1104  KEY `AssignedGroup` (`AssignedGroup`),
     1105  KEY `AssignedOperation` (`AssignedOperation`)
     1106) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=48 ;
     1107
     1108--
     1109-- RELACE PRO TABULKU `PermissionGroupAssignment`:
     1110--   `Group`
     1111--       `PermissionGroup` -> `Id`
     1112--   `AssignedGroup`
     1113--       `PermissionGroup` -> `Id`
     1114--   `AssignedOperation`
     1115--       `PermissionOperation` -> `Id`
     1116--
     1117
     1118-- --------------------------------------------------------
     1119
     1120--
     1121-- Struktura tabulky `PermissionOperation`
     1122--
     1123
     1124CREATE TABLE IF NOT EXISTS `PermissionOperation` (
     1125  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1126  `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1127  `Operation` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1128  `Item` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1129  `ItemId` int(11) NOT NULL DEFAULT '0',
     1130  PRIMARY KEY (`Id`),
     1131  KEY `Module` (`Module`),
     1132  KEY `Operation` (`Operation`),
     1133  KEY `Item` (`Item`),
     1134  KEY `ItemId` (`ItemId`)
     1135) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=45 ;
     1136
     1137-- --------------------------------------------------------
     1138
     1139--
     1140-- Struktura tabulky `PermissionUserAssignment`
     1141--
     1142
     1143CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` (
     1144  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1145  `User` int(11) NOT NULL DEFAULT '0',
     1146  `AssignedGroup` int(11) DEFAULT NULL,
     1147  `AssignedOperation` int(11) DEFAULT NULL,
     1148  PRIMARY KEY (`Id`),
     1149  KEY `User` (`User`),
     1150  KEY `AssignedGroup` (`AssignedGroup`),
     1151  KEY `AssignedOperation` (`AssignedOperation`)
     1152) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=225 ;
     1153
     1154--
     1155-- RELACE PRO TABULKU `PermissionUserAssignment`:
     1156--   `User`
     1157--       `User` -> `Id`
     1158--   `AssignedGroup`
     1159--       `PermissionGroup` -> `Id`
     1160--   `AssignedOperation`
     1161--       `PermissionOperation` -> `Id`
     1162--
     1163
     1164-- --------------------------------------------------------
     1165
     1166--
     1167-- Struktura tabulky `PhoneBook`
     1168--
     1169
     1170CREATE TABLE IF NOT EXISTS `PhoneBook` (
     1171  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1172  `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1173  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1174  `Address` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1175  `LastUpdate` datetime NOT NULL,
     1176  `Operator` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1177  PRIMARY KEY (`Id`)
     1178) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=53 ;
     1179
     1180-- --------------------------------------------------------
     1181
     1182--
     1183-- Struktura tabulky `Product`
     1184--
     1185
     1186CREATE TABLE IF NOT EXISTS `Product` (
     1187  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1188  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1189  `SellPrice` float NOT NULL,
     1190  `BuyPrice` float NOT NULL,
     1191  `VAT` float DEFAULT NULL,
     1192  `Consumption` int(11) DEFAULT NULL COMMENT 'In Watts',
     1193  `Supplier` int(11) DEFAULT NULL COMMENT 'Subject',
     1194  `Manufacturer` int(11) DEFAULT NULL,
     1195  `Code` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     1196  `UnitOfMeasure` int(11) NOT NULL,
     1197  PRIMARY KEY (`Id`),
     1198  UNIQUE KEY `Code` (`Code`),
     1199  KEY `Supplier` (`Supplier`),
     1200  KEY `UnitOfMeasure` (`UnitOfMeasure`),
     1201  KEY `Manufacturer` (`Manufacturer`)
     1202) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=166 ;
     1203
     1204--
     1205-- RELACE PRO TABULKU `Product`:
     1206--   `Supplier`
     1207--       `Subject` -> `Id`
     1208--   `Manufacturer`
     1209--       `Subject` -> `Id`
     1210--   `UnitOfMeasure`
     1211--       `UnitOfMeasure` -> `Id`
     1212--
     1213
     1214-- --------------------------------------------------------
     1215
     1216--
     1217-- Struktura tabulky `ProductOld`
     1218--
     1219
     1220CREATE TABLE IF NOT EXISTS `ProductOld` (
     1221  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1222  `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
     1223  `Price` int(11) NOT NULL DEFAULT '0',
     1224  `Count` int(11) NOT NULL DEFAULT '1',
     1225  `Date` date NOT NULL DEFAULT '0000-00-00',
     1226  `Segment` int(11) DEFAULT '0',
     1227  `Used` int(11) NOT NULL DEFAULT '0',
     1228  `Consumption` int(11) NOT NULL DEFAULT '0',
     1229  `User` int(11) DEFAULT '0',
     1230  `Info` text COLLATE utf8_czech_ci NOT NULL,
     1231  `Channel` int(11) NOT NULL DEFAULT '0',
     1232  `DeviceId` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1233  `Shop` varchar(64) COLLATE utf8_czech_ci NOT NULL,
     1234  `DeprecatedPrice` int(11) NOT NULL DEFAULT '0',
     1235  `TimeEnlistment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1236  `TimeElimination` datetime DEFAULT '0000-00-00 00:00:00',
     1237  `StockCard` int(11) NOT NULL,
     1238  PRIMARY KEY (`Id`),
     1239  KEY `Segment` (`Segment`),
     1240  KEY `Used` (`Used`),
     1241  KEY `User` (`User`)
     1242) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=164 ;
     1243
     1244--
     1245-- RELACE PRO TABULKU `ProductOld`:
     1246--   `Segment`
     1247--       `NetworkSegment` -> `Id`
     1248--
     1249
     1250-- --------------------------------------------------------
     1251
     1252--
     1253-- Struktura tabulky `Service`
     1254--
     1255
     1256CREATE TABLE IF NOT EXISTS `Service` (
     1257  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1258  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1259  PRIMARY KEY (`Id`)
     1260) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
     1261
     1262-- --------------------------------------------------------
     1263
     1264--
     1265-- Struktura tabulky `Stock`
     1266--
     1267
     1268CREATE TABLE IF NOT EXISTS `Stock` (
     1269  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1270  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1271  `Location` int(11) DEFAULT NULL,
     1272  PRIMARY KEY (`Id`),
     1273  KEY `Location` (`Location`)
     1274) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     1275
     1276--
     1277-- RELACE PRO TABULKU `Stock`:
     1278--   `Location`
     1279--       `Member` -> `Id`
     1280--
     1281
     1282-- --------------------------------------------------------
     1283
     1284--
     1285-- Struktura tabulky `StockItem`
     1286--
     1287
     1288CREATE TABLE IF NOT EXISTS `StockItem` (
     1289  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1290  `Stock` int(11) NOT NULL,
     1291  `Product` int(11) NOT NULL,
     1292  `TimeEnlistment` date NOT NULL,
     1293  `TimeElimination` date DEFAULT NULL,
     1294  `BuyPrice` decimal(10,0) NOT NULL,
     1295  `SellPrice` decimal(10,0) NOT NULL,
     1296  `Amount` float NOT NULL,
     1297  `SerialNumber` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
     1298  `Location` int(11) DEFAULT NULL COMMENT 'Member',
     1299  `Segment` int(11) DEFAULT NULL,
     1300  `Info` text COLLATE utf8_czech_ci NOT NULL,
     1301  PRIMARY KEY (`Id`),
     1302  UNIQUE KEY `SerialNumber` (`SerialNumber`),
     1303  KEY `Product` (`Product`),
     1304  KEY `Stock` (`Stock`),
     1305  KEY `Segment` (`Segment`),
     1306  KEY `Location` (`Location`)
     1307) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=164 ;
     1308
     1309--
     1310-- RELACE PRO TABULKU `StockItem`:
     1311--   `Location`
     1312--       `Member` -> `Id`
     1313--   `Stock`
     1314--       `Stock` -> `Id`
     1315--   `StockCard`
     1316--       `StockCard` -> `Id`
     1317--   `Product`
     1318--       `Product` -> `Id`
     1319--   `Segment`
     1320--       `NetworkSegment` -> `Id`
     1321--
     1322
     1323-- --------------------------------------------------------
     1324
     1325--
     1326-- Struktura tabulky `Subject`
     1327--
     1328
     1329CREATE TABLE IF NOT EXISTS `Subject` (
     1330  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1331  `Name` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1332  `AddressStreet` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1333  `AddressTown` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1334  `AddressPSC` int(11) NOT NULL DEFAULT '0',
     1335  `AddressCountry` int(11) NOT NULL,
     1336  `IC` varchar(32) COLLATE utf8_czech_ci NOT NULL,
     1337  `DIC` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1338  `MapPositionX` float NOT NULL DEFAULT '0',
     1339  `MapPositionY` float NOT NULL DEFAULT '0',
     1340  `WWW` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1341  `Note` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1342  PRIMARY KEY (`Id`),
     1343  KEY `AddressCountry` (`AddressCountry`)
     1344) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=229 ;
     1345
     1346--
     1347-- RELACE PRO TABULKU `Subject`:
     1348--   `AddressCountry`
     1349--       `Country` -> `Id`
     1350--
     1351
     1352-- --------------------------------------------------------
     1353
     1354--
     1355-- Struktura tabulky `SubjectOpenTime`
     1356--
     1357
     1358CREATE TABLE IF NOT EXISTS `SubjectOpenTime` (
     1359  `Subject` int(11) NOT NULL DEFAULT '0',
     1360  `UpdateTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1361  `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1362  `Photo` int(11) NOT NULL,
     1363  KEY `Subject` (`Subject`)
     1364) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     1365
     1366--
     1367-- RELACE PRO TABULKU `SubjectOpenTime`:
     1368--   `Subject`
     1369--       `Subject` -> `Id`
     1370--
     1371
     1372-- --------------------------------------------------------
     1373
     1374--
     1375-- Struktura tabulky `SubjectOpenTimeDay`
     1376--
     1377
     1378CREATE TABLE IF NOT EXISTS `SubjectOpenTimeDay` (
     1379  `Subject` int(11) NOT NULL,
     1380  `Day` int(11) NOT NULL,
     1381  `Open1` int(11) NOT NULL,
     1382  `Close1` int(11) NOT NULL,
     1383  `Open2` int(11) NOT NULL,
     1384  `Close2` int(11) NOT NULL,
     1385  KEY `Subject` (`Subject`)
     1386) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
     1387
     1388--
     1389-- RELACE PRO TABULKU `SubjectOpenTimeDay`:
     1390--   `Subject`
     1391--       `Subject` -> `Id`
     1392--
     1393
     1394-- --------------------------------------------------------
     1395
     1396--
     1397-- Struktura tabulky `SystemVersion`
     1398--
     1399
     1400CREATE TABLE IF NOT EXISTS `SystemVersion` (
     1401  `Rev464` bit(1) DEFAULT NULL
     1402) ENGINE=InnoDB DEFAULT CHARSET=utf8;
     1403
     1404-- --------------------------------------------------------
     1405
     1406--
     1407-- Struktura tabulky `Task`
     1408--
     1409
     1410CREATE TABLE IF NOT EXISTS `Task` (
     1411  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1412  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1413  `Description` text COLLATE utf8_czech_ci NOT NULL,
     1414  `TimeCreate` date NOT NULL,
     1415  `TimeDue` date DEFAULT NULL,
     1416  `TimeClose` date DEFAULT NULL,
     1417  `Priority` int(11) NOT NULL,
     1418  `Conclusion` text COLLATE utf8_czech_ci NOT NULL,
     1419  `Public` int(11) NOT NULL,
     1420  `Progress` int(11) NOT NULL,
     1421  `Group` int(11) DEFAULT NULL,
     1422  `AssignedTo` int(11) DEFAULT NULL,
     1423  PRIMARY KEY (`Id`),
     1424  KEY `Group` (`Group`),
     1425  KEY `AssignedTo` (`AssignedTo`)
     1426) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;
     1427
     1428--
     1429-- RELACE PRO TABULKU `Task`:
     1430--   `Group`
     1431--       `TaskGroup` -> `Id`
     1432--   `AssignedTo`
     1433--       `User` -> `Id`
     1434--
     1435
     1436-- --------------------------------------------------------
     1437
     1438--
     1439-- Struktura tabulky `TaskGroup`
     1440--
     1441
     1442CREATE TABLE IF NOT EXISTS `TaskGroup` (
     1443  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1444  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1445  `Description` text COLLATE utf8_czech_ci NOT NULL,
     1446  `Parent` int(11) DEFAULT NULL,
     1447  PRIMARY KEY (`Id`),
     1448  KEY `Parent` (`Parent`)
     1449) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ;
     1450
     1451--
     1452-- RELACE PRO TABULKU `TaskGroup`:
     1453--   `Parent`
     1454--       `TaskGroup` -> `Id`
     1455--
     1456
     1457-- --------------------------------------------------------
     1458
     1459--
     1460-- Struktura tabulky `TV`
     1461--
     1462
     1463CREATE TABLE IF NOT EXISTS `TV` (
     1464  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1465  `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     1466  `Frequency` int(11) NOT NULL DEFAULT '0',
     1467  `Norm` varchar(8) COLLATE utf8_czech_ci NOT NULL,
     1468  `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1469  `Language` int(11) DEFAULT NULL,
     1470  `ShortName` varchar(16) COLLATE utf8_czech_ci NOT NULL,
     1471  `Stream` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1472  `StreamWeb` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1473  `SourceType` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1474  `Category` int(11) DEFAULT NULL,
     1475  PRIMARY KEY (`Id`),
     1476  UNIQUE KEY `ShortName` (`ShortName`),
     1477  KEY `Language` (`Language`),
     1478  KEY `Category` (`Category`)
     1479) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=46 ;
     1480
     1481--
     1482-- RELACE PRO TABULKU `TV`:
     1483--   `Language`
     1484--       `Language` -> `Id`
     1485--   `Category`
     1486--       `TVGroup` -> `Id`
     1487--
     1488
     1489-- --------------------------------------------------------
     1490
     1491--
     1492-- Struktura tabulky `TVGroup`
     1493--
     1494
     1495CREATE TABLE IF NOT EXISTS `TVGroup` (
     1496  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1497  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1498  PRIMARY KEY (`Id`)
     1499) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;
     1500
     1501-- --------------------------------------------------------
     1502
     1503--
     1504-- Struktura tabulky `UnitOfMeasure`
     1505--
     1506
     1507CREATE TABLE IF NOT EXISTS `UnitOfMeasure` (
     1508  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1509  `Unit` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1510  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1511  PRIMARY KEY (`Id`)
     1512) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
     1513
     1514-- --------------------------------------------------------
     1515
     1516--
     1517-- Struktura tabulky `User`
     1518--
     1519
     1520CREATE TABLE IF NOT EXISTS `User` (
     1521  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1522  `Login` varchar(64) COLLATE utf8_czech_ci NOT NULL,
     1523  `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
     1524  `Password` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1525  `Salt` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1526  `Email` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1527  `LastIpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1528  `LastLoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1529  `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1530  `Locked` tinyint(1) NOT NULL DEFAULT '0',
     1531  `ICQ` int(11) NOT NULL DEFAULT '0',
     1532  `PhoneNumber` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1533  `InitPassword` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1534  PRIMARY KEY (`Id`),
     1535  UNIQUE KEY `Name` (`Login`),
     1536  UNIQUE KEY `Nick` (`Name`)
     1537) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=250 ;
     1538
     1539-- --------------------------------------------------------
     1540
     1541--
     1542-- Struktura tabulky `UserCustomerRel`
     1543--
     1544
     1545CREATE TABLE IF NOT EXISTS `UserCustomerRel` (
     1546  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1547  `Customer` int(11) NOT NULL,
     1548  `User` int(11) NOT NULL,
     1549  PRIMARY KEY (`Id`),
     1550  KEY `Customer` (`Customer`),
     1551  KEY `User` (`User`)
     1552) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=519 ;
     1553
     1554--
     1555-- RELACE PRO TABULKU `UserCustomerRel`:
     1556--   `Customer`
     1557--       `Member` -> `Id`
     1558--   `User`
     1559--       `User` -> `Id`
     1560--
     1561
     1562-- --------------------------------------------------------
     1563
     1564--
     1565-- Struktura tabulky `UserOnline`
     1566--
     1567
     1568CREATE TABLE IF NOT EXISTS `UserOnline` (
     1569  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1570  `User` int(11) NOT NULL DEFAULT '0' COMMENT 'User.Id',
     1571  `ActivityTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1572  `LoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     1573  `SessionId` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1574  `IpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1575  `HostName` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
     1576  `ScriptName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     1577  PRIMARY KEY (`Id`),
     1578  KEY `User` (`User`)
     1579) ENGINE=MEMORY  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6761 ;
     1580
     1581-- --------------------------------------------------------
     1582
     1583--
     1584-- Struktura tabulky `Work`
     1585--
     1586
     1587CREATE TABLE IF NOT EXISTS `Work` (
     1588  `Id` int(11) NOT NULL AUTO_INCREMENT,
     1589  `Name` varchar(255) NOT NULL,
     1590  `Description` text,
     1591  `TimeStart` datetime NOT NULL,
     1592  `Duration` float NOT NULL,
     1593  `User` int(11) DEFAULT NULL,
     1594  `Task` int(11) DEFAULT NULL,
     1595  PRIMARY KEY (`Id`),
     1596  KEY `User` (`User`),
     1597  KEY `Task` (`Task`),
     1598  KEY `TimeStart` (`TimeStart`)
     1599) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     1600
     1601--
     1602-- RELACE PRO TABULKU `Work`:
     1603--   `User`
     1604--       `User` -> `Id`
     1605--   `Task`
     1606--       `Task` -> `Id`
     1607--
     1608
    391609--
    401610-- Omezení pro exportované tabulky
    411611--
     1612
     1613--
     1614-- Omezení pro tabulku `DocumentLineSequence`
     1615--
     1616ALTER TABLE `DocumentLineSequence`
     1617  ADD CONSTRAINT `DocumentLineSequence_ibfk_1` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`),
     1618  ADD CONSTRAINT `DocumentLineSequence_ibfk_2` FOREIGN KEY (`FinanceYear`) REFERENCES `FinanceYear` (`Id`);
     1619
     1620--
     1621-- Omezení pro tabulku `FinanceBills`
     1622--
     1623ALTER TABLE `FinanceBills`
     1624  ADD CONSTRAINT `FinanceBills_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
     1625
     1626--
     1627-- Omezení pro tabulku `FinanceBillsItems`
     1628--
     1629ALTER TABLE `FinanceBillsItems`
     1630  ADD CONSTRAINT `FinanceBillsItems_ibfk_1` FOREIGN KEY (`Bill`) REFERENCES `FinanceBills` (`Id`);
     1631
     1632--
     1633-- Omezení pro tabulku `FinanceClaimsLiabilities`
     1634--
     1635ALTER TABLE `FinanceClaimsLiabilities`
     1636  ADD CONSTRAINT `FinanceClaimsLiabilities_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
     1637
     1638--
     1639-- Omezení pro tabulku `FinanceOperation`
     1640--
     1641ALTER TABLE `FinanceOperation`
     1642  ADD CONSTRAINT `FinanceOperation_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
     1643  ADD CONSTRAINT `FinanceOperation_ibfk_2` FOREIGN KEY (`Bill`) REFERENCES `FinanceBills` (`Id`),
     1644  ADD CONSTRAINT `FinanceOperation_ibfk_3` FOREIGN KEY (`BankAccount`) REFERENCES `FinanceBankAccount` (`Id`),
     1645  ADD CONSTRAINT `FinanceOperation_ibfk_4` FOREIGN KEY (`Treasury`) REFERENCES `FinanceTreasury` (`Id`);
     1646
     1647--
     1648-- Omezení pro tabulku `Hyperlink`
     1649--
     1650ALTER TABLE `Hyperlink`
     1651  ADD CONSTRAINT `Hyperlink_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `HyperlinkGroup` (`Id`);
     1652
     1653--
     1654-- Omezení pro tabulku `ISMenuItem`
     1655--
     1656ALTER TABLE `ISMenuItem`
     1657  ADD CONSTRAINT `ISMenuItem_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `ISMenuItem` (`Id`);
    421658
    431659--
     
    461662ALTER TABLE `Log`
    471663  ADD CONSTRAINT `Log_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
     1664
     1665--
     1666-- Omezení pro tabulku `Member`
     1667--
     1668ALTER TABLE `Member`
     1669  ADD CONSTRAINT `Member_ibfk_23` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
     1670  ADD CONSTRAINT `Member_ibfk_24` FOREIGN KEY (`ResponsibleUser`) REFERENCES `User` (`Id`),
     1671  ADD CONSTRAINT `Member_ibfk_25` FOREIGN KEY (`InternetTariffCurrentMonth`) REFERENCES `FinanceTariff` (`Id`),
     1672  ADD CONSTRAINT `Member_ibfk_26` FOREIGN KEY (`InternetTariffNextMonth`) REFERENCES `FinanceTariff` (`Id`),
     1673  ADD CONSTRAINT `Member_ibfk_27` FOREIGN KEY (`BillingPeriod`) REFERENCES `FinanceBillingPeriod` (`Id`),
     1674  ADD CONSTRAINT `Member_ibfk_28` FOREIGN KEY (`BillingPeriodNext`) REFERENCES `FinanceBillingPeriod` (`Id`);
     1675
     1676--
     1677-- Omezení pro tabulku `MemberPayment`
     1678--
     1679ALTER TABLE `MemberPayment`
     1680  ADD CONSTRAINT `MemberPayment_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);
     1681
     1682--
     1683-- Omezení pro tabulku `NetworkAP`
     1684--
     1685ALTER TABLE `NetworkAP`
     1686  ADD CONSTRAINT `NetworkAP_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);
     1687
     1688--
     1689-- Omezení pro tabulku `NetworkDevice`
     1690--
     1691ALTER TABLE `NetworkDevice`
     1692  ADD CONSTRAINT `NetworkDevice_ibfk_4` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`),
     1693  ADD CONSTRAINT `NetworkDevice_ibfk_5` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`),
     1694  ADD CONSTRAINT `NetworkDevice_ibfk_6` FOREIGN KEY (`Type`) REFERENCES `NetworkDeviceType` (`Id`);
     1695
     1696--
     1697-- Omezení pro tabulku `NetworkDeviceConfig`
     1698--
     1699ALTER TABLE `NetworkDeviceConfig`
     1700  ADD CONSTRAINT `NetworkDeviceConfig_ibfk_1` FOREIGN KEY (`Device`) REFERENCES `NetworkDevice` (`Id`);
     1701
     1702--
     1703-- Omezení pro tabulku `NetworkFirewall`
     1704--
     1705ALTER TABLE `NetworkFirewall`
     1706  ADD CONSTRAINT `NetworkFirewall_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);
     1707
     1708--
     1709-- Omezení pro tabulku `NetworkInterface`
     1710--
     1711ALTER TABLE `NetworkInterface`
     1712  ADD CONSTRAINT `NetworkInterface_ibfk_1` FOREIGN KEY (`Type`) REFERENCES `NetworkInterfaceType` (`Id`),
     1713  ADD CONSTRAINT `NetworkInterface_ibfk_2` FOREIGN KEY (`Device`) REFERENCES `NetworkDevice` (`Id`);
     1714
     1715--
     1716-- Omezení pro tabulku `NetworkSegment`
     1717--
     1718ALTER TABLE `NetworkSegment`
     1719  ADD CONSTRAINT `NetworkSegment_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `NetworkSegment` (`Id`);
     1720
     1721--
     1722-- Omezení pro tabulku `NetworkSubnet`
     1723--
     1724ALTER TABLE `NetworkSubnet`
     1725  ADD CONSTRAINT `NetworkSubnet_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);
     1726
     1727--
     1728-- Omezení pro tabulku `News`
     1729--
     1730ALTER TABLE `News`
     1731  ADD CONSTRAINT `News_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `NewsCategory` (`Id`),
     1732  ADD CONSTRAINT `News_ibfk_2` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
     1733
     1734--
     1735-- Omezení pro tabulku `Panel`
     1736--
     1737ALTER TABLE `Panel`
     1738  ADD CONSTRAINT `Panel_ibfk_1` FOREIGN KEY (`PanelColumn`) REFERENCES `PanelColumn` (`Id`);
     1739
     1740--
     1741-- Omezení pro tabulku `PermissionGroupAssignment`
     1742--
     1743ALTER TABLE `PermissionGroupAssignment`
     1744  ADD CONSTRAINT `PermissionGroupAssignment_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `PermissionGroup` (`Id`),
     1745  ADD CONSTRAINT `PermissionGroupAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`),
     1746  ADD CONSTRAINT `PermissionGroupAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`);
     1747
     1748--
     1749-- Omezení pro tabulku `PermissionUserAssignment`
     1750--
     1751ALTER TABLE `PermissionUserAssignment`
     1752  ADD CONSTRAINT `PermissionUserAssignment_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
     1753  ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`),
     1754  ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`);
     1755
     1756--
     1757-- Omezení pro tabulku `Product`
     1758--
     1759ALTER TABLE `Product`
     1760  ADD CONSTRAINT `Product_ibfk_1` FOREIGN KEY (`Supplier`) REFERENCES `Subject` (`Id`),
     1761  ADD CONSTRAINT `Product_ibfk_2` FOREIGN KEY (`Manufacturer`) REFERENCES `Subject` (`Id`),
     1762  ADD CONSTRAINT `Product_ibfk_3` FOREIGN KEY (`UnitOfMeasure`) REFERENCES `UnitOfMeasure` (`Id`);
     1763
     1764--
     1765-- Omezení pro tabulku `ProductOld`
     1766--
     1767ALTER TABLE `ProductOld`
     1768  ADD CONSTRAINT `ProductOld_ibfk_1` FOREIGN KEY (`Segment`) REFERENCES `NetworkSegment` (`Id`);
     1769
     1770--
     1771-- Omezení pro tabulku `Stock`
     1772--
     1773ALTER TABLE `Stock`
     1774  ADD CONSTRAINT `Stock_ibfk_1` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`);
     1775
     1776--
     1777-- Omezení pro tabulku `StockItem`
     1778--
     1779ALTER TABLE `StockItem`
     1780  ADD CONSTRAINT `StockItem_ibfk_1` FOREIGN KEY (`Stock`) REFERENCES `Stock` (`Id`),
     1781  ADD CONSTRAINT `StockItem_ibfk_3` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`),
     1782  ADD CONSTRAINT `StockItem_ibfk_5` FOREIGN KEY (`Product`) REFERENCES `Product` (`Id`),
     1783  ADD CONSTRAINT `StockItem_ibfk_6` FOREIGN KEY (`Segment`) REFERENCES `NetworkSegment` (`Id`);
     1784
     1785--
     1786-- Omezení pro tabulku `Subject`
     1787--
     1788ALTER TABLE `Subject`
     1789  ADD CONSTRAINT `Subject_ibfk_1` FOREIGN KEY (`AddressCountry`) REFERENCES `Country` (`Id`);
     1790
     1791--
     1792-- Omezení pro tabulku `SubjectOpenTime`
     1793--
     1794ALTER TABLE `SubjectOpenTime`
     1795  ADD CONSTRAINT `SubjectOpenTime_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
     1796
     1797--
     1798-- Omezení pro tabulku `SubjectOpenTimeDay`
     1799--
     1800ALTER TABLE `SubjectOpenTimeDay`
     1801  ADD CONSTRAINT `SubjectOpenTimeDay_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
     1802
     1803--
     1804-- Omezení pro tabulku `Task`
     1805--
     1806ALTER TABLE `Task`
     1807  ADD CONSTRAINT `Task_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `TaskGroup` (`Id`),
     1808  ADD CONSTRAINT `Task_ibfk_2` FOREIGN KEY (`AssignedTo`) REFERENCES `User` (`Id`);
     1809
     1810--
     1811-- Omezení pro tabulku `TaskGroup`
     1812--
     1813ALTER TABLE `TaskGroup`
     1814  ADD CONSTRAINT `TaskGroup_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `TaskGroup` (`Id`);
     1815
     1816--
     1817-- Omezení pro tabulku `TV`
     1818--
     1819ALTER TABLE `TV`
     1820  ADD CONSTRAINT `TV_ibfk_1` FOREIGN KEY (`Language`) REFERENCES `Language` (`Id`),
     1821  ADD CONSTRAINT `TV_ibfk_2` FOREIGN KEY (`Category`) REFERENCES `TVGroup` (`Id`);
     1822
     1823--
     1824-- Omezení pro tabulku `UserCustomerRel`
     1825--
     1826ALTER TABLE `UserCustomerRel`
     1827  ADD CONSTRAINT `usercustomerrel_ibfk_1` FOREIGN KEY (`Customer`) REFERENCES `Member` (`Id`),
     1828  ADD CONSTRAINT `usercustomerrel_ibfk_2` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
     1829
     1830--
     1831-- Omezení pro tabulku `Work`
     1832--
     1833ALTER TABLE `Work`
     1834  ADD CONSTRAINT `Work_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
     1835  ADD CONSTRAINT `Work_ibfk_2` FOREIGN KEY (`Task`) REFERENCES `Task` (`Id`);
Note: See TracChangeset for help on using the changeset viewer.