source: trunk/Application/FullInstall.php

Last change on this file was 887, checked in by chronos, 4 years ago
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
File size: 80.7 KB
Line 
1<?php
2
3function FullInstall(UpdateManager $Manager): void
4{
5 $Manager->Execute("
6--
7-- Funkce
8--
9CREATE DEFINER=`centrala`@`localhost` FUNCTION `CompareNetworkPrefix`(Address1 INT(11) UNSIGNED, Address2 INT(11) UNSIGNED, Size INT(11)) RETURNS tinyint(1)
10RETURN Address1 & (-1 << (32 - Size)) = Address2 & (-1 << (32 - Size));
11
12--
13-- Struktura tabulky `ChatHistory`
14--
15
16CREATE TABLE IF NOT EXISTS `ChatHistory` (
17 `Id` int(11) NOT NULL AUTO_INCREMENT,
18 `Nick` varchar(64) COLLATE utf8_czech_ci NOT NULL,
19 `Text` text COLLATE utf8_czech_ci NOT NULL,
20 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
21 `Color` int(11) NOT NULL DEFAULT '0',
22 `RoomName` varchar(32) COLLATE utf8_czech_ci NOT NULL,
23 `RoomType` int(11) NOT NULL DEFAULT '0',
24 `Host` varchar(255) COLLATE utf8_czech_ci NOT NULL,
25 PRIMARY KEY (`Id`)
26) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=528576 ;
27
28-- --------------------------------------------------------
29
30--
31-- Struktura tabulky `Country`
32--
33
34CREATE TABLE IF NOT EXISTS `Country` (
35 `Id` int(11) NOT NULL AUTO_INCREMENT,
36 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
37 PRIMARY KEY (`Id`)
38) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
39
40-- --------------------------------------------------------
41
42--
43-- Struktura tabulky `DocumentLine`
44--
45
46CREATE TABLE IF NOT EXISTS `DocumentLine` (
47 `Id` int(11) NOT NULL AUTO_INCREMENT,
48 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
49 `Shortcut` varchar(16) COLLATE utf8_czech_ci NOT NULL,
50 PRIMARY KEY (`Id`),
51 UNIQUE KEY `Shortcut` (`Shortcut`)
52) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=9 ;
53
54-- --------------------------------------------------------
55
56--
57-- Struktura tabulky `DocumentLineSequence`
58--
59
60CREATE TABLE IF NOT EXISTS `DocumentLineSequence` (
61 `Id` int(11) NOT NULL AUTO_INCREMENT,
62 `DocumentLine` int(11) NOT NULL,
63 `FinanceYear` int(11) NOT NULL,
64 `NextNumber` int(11) NOT NULL,
65 `YearPrefix` int(11) NOT NULL,
66 PRIMARY KEY (`Id`),
67 KEY `DocumentLine` (`DocumentLine`),
68 KEY `FinanceYear` (`FinanceYear`)
69) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=35 ;
70
71--
72-- RELACE PRO TABULKU `DocumentLineSequence`:
73-- `DocumentLine`
74-- `DocumentLine` -> `Id`
75-- `FinanceYear`
76-- `FinanceYear` -> `Id`
77--
78
79-- --------------------------------------------------------
80
81--
82-- Struktura tabulky `EmailQueue`
83--
84
85CREATE TABLE IF NOT EXISTS `EmailQueue` (
86 `Id` int(11) NOT NULL AUTO_INCREMENT,
87 `Time` datetime NOT NULL,
88 `To` varchar(255) COLLATE utf8_czech_ci NOT NULL,
89 `Subject` varchar(255) COLLATE utf8_czech_ci NOT NULL,
90 `Content` text COLLATE utf8_czech_ci NOT NULL,
91 `Headers` varchar(255) COLLATE utf8_czech_ci NOT NULL,
92 `Archive` int(11) NOT NULL DEFAULT '0',
93 `From` varchar(255) COLLATE utf8_czech_ci NOT NULL,
94 `AttachmentFile` int(11) DEFAULT NULL,
95 PRIMARY KEY (`Id`),
96 KEY `Archive` (`Archive`)
97) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3127 ;
98
99-- --------------------------------------------------------
100
101--
102-- Struktura tabulky `Employee`
103--
104
105CREATE TABLE IF NOT EXISTS `Employee` (
106 `Id` int(11) NOT NULL AUTO_INCREMENT,
107 `FirstName` varchar(255) NOT NULL,
108 `SecondName` varchar(255) NOT NULL,
109 `Salary` int(11) NOT NULL,
110 `ValidFrom` date NOT NULL,
111 `ValidTo` date DEFAULT NULL,
112 PRIMARY KEY (`Id`)
113) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
114
115-- --------------------------------------------------------
116
117--
118-- Struktura tabulky `EmployeeSalary`
119--
120
121CREATE TABLE IF NOT EXISTS `EmployeeSalary` (
122 `Id` int(11) NOT NULL AUTO_INCREMENT,
123 `Date` date NOT NULL,
124 `Employee` int(11) NOT NULL,
125 `Amount` int(11) NOT NULL,
126 PRIMARY KEY (`Id`),
127 KEY `Employee` (`Employee`)
128) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
129
130-- --------------------------------------------------------
131
132--
133-- Struktura tabulky `File`
134--
135
136CREATE TABLE IF NOT EXISTS `File` (
137 `Id` int(11) NOT NULL AUTO_INCREMENT,
138 `Name` varchar(256) COLLATE utf8_czech_ci NOT NULL,
139 `Size` int(11) NOT NULL,
140 `Directory` int(11) DEFAULT NULL,
141 PRIMARY KEY (`Id`),
142 KEY `Directory` (`Directory`)
143) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6298 ;
144
145--
146-- RELACE PRO TABULKU `File`:
147-- `Directory`
148-- `FileDirectory` -> `Id`
149--
150
151-- --------------------------------------------------------
152
153--
154-- Struktura tabulky `FileDirectory`
155--
156
157CREATE TABLE IF NOT EXISTS `FileDirectory` (
158 `Id` int(11) NOT NULL AUTO_INCREMENT,
159 `Name` varchar(255) NOT NULL,
160 `Parent` int(11) DEFAULT NULL,
161 PRIMARY KEY (`Id`),
162 KEY `Parent` (`Parent`)
163) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
164
165--
166-- RELACE PRO TABULKU `FileDirectory`:
167-- `Parent`
168-- `FileDirectory` -> `Id`
169--
170
171-- --------------------------------------------------------
172
173--
174-- Struktura tabulky `FinanceAssetsHistory`
175--
176
177CREATE TABLE IF NOT EXISTS `FinanceAssetsHistory` (
178 `AssetsId` int(11) NOT NULL DEFAULT '0',
179 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
180 `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
181 `User` int(11) NOT NULL DEFAULT '0',
182 KEY `AssetsId` (`AssetsId`)
183) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
184
185-- --------------------------------------------------------
186
187--
188-- Struktura tabulky `FinanceBankAccount`
189--
190
191CREATE TABLE IF NOT EXISTS `FinanceBankAccount` (
192 `Id` int(11) NOT NULL AUTO_INCREMENT,
193 `TimeCreate` date NOT NULL,
194 `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
195 `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
196 `Subject` int(11) DEFAULT NULL,
197 `TimeEnd` date DEFAULT NULL,
198 `Use` int(11) NOT NULL,
199 PRIMARY KEY (`Id`),
200 KEY `Subject` (`Subject`)
201) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
202
203--
204-- RELACE PRO TABULKU `FinanceBankAccount`:
205-- `Subject`
206-- `Subject` -> `Id`
207--
208
209-- --------------------------------------------------------
210
211--
212-- Struktura tabulky `FinanceBillingPeriod`
213--
214
215CREATE TABLE IF NOT EXISTS `FinanceBillingPeriod` (
216 `Id` int(11) NOT NULL AUTO_INCREMENT,
217 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
218 `MonthCount` int(11) NOT NULL,
219 PRIMARY KEY (`Id`)
220) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;
221
222-- --------------------------------------------------------
223
224--
225-- Struktura tabulky `FinanceBillsItemsOld`
226--
227
228CREATE TABLE IF NOT EXISTS `FinanceBillsItemsOld` (
229 `Id` int(11) NOT NULL AUTO_INCREMENT,
230 `Bill` int(11) NOT NULL DEFAULT '0',
231 `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL,
232 `Price` float NOT NULL DEFAULT '0',
233 `Quantity` float NOT NULL DEFAULT '1',
234 PRIMARY KEY (`Id`),
235 KEY `Bill` (`Bill`)
236) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17839 ;
237
238--
239-- RELACE PRO TABULKU `FinanceBillsItemsOld`:
240-- `Bill`
241-- `FinanceBillsOld` -> `Id`
242--
243
244-- --------------------------------------------------------
245
246--
247-- Struktura tabulky `FinanceBillsOld`
248--
249
250CREATE TABLE IF NOT EXISTS `FinanceBillsOld` (
251 `Id` int(11) NOT NULL AUTO_INCREMENT,
252 `TimeFrom` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
253 `Subject` int(11) NOT NULL DEFAULT '0',
254 `PeriodFrom` date DEFAULT NULL,
255 `PeriodTo` date DEFAULT NULL,
256 `TimeCreate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
257 `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
258 `BillCode` varchar(32) COLLATE utf8_czech_ci NOT NULL,
259 `Type` enum('invoice','income') COLLATE utf8_czech_ci NOT NULL,
260 `Cash` int(11) NOT NULL DEFAULT '0',
261 PRIMARY KEY (`Id`),
262 KEY `Subject` (`Subject`),
263 KEY `Subject_2` (`Subject`)
264) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6298 ;
265
266--
267-- RELACE PRO TABULKU `FinanceBillsOld`:
268-- `Subject`
269-- `Subject` -> `Id`
270--
271
272-- --------------------------------------------------------
273
274--
275-- Struktura tabulky `FinanceCharge`
276--
277
278CREATE TABLE IF NOT EXISTS `FinanceCharge` (
279 `Period` int(11) NOT NULL DEFAULT '0',
280 `Internet` int(11) NOT NULL DEFAULT '0',
281 `InternetSpeed` int(11) NOT NULL DEFAULT '0',
282 `InternetSpeedReserve` int(11) NOT NULL DEFAULT '0',
283 `AdministrationPerUser` int(20) NOT NULL DEFAULT '0',
284 `kWh` int(11) NOT NULL DEFAULT '0',
285 `BaseSpeedElement` int(11) NOT NULL DEFAULT '0',
286 `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
287 `TopTariffPrice` int(11) NOT NULL DEFAULT '0'
288) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
289
290-- --------------------------------------------------------
291
292--
293-- Struktura tabulky `FinanceGroup`
294--
295
296CREATE TABLE IF NOT EXISTS `FinanceGroup` (
297 `Id` int(11) NOT NULL AUTO_INCREMENT,
298 `Description` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
299 PRIMARY KEY (`Id`)
300) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
301
302-- --------------------------------------------------------
303
304--
305-- Struktura tabulky `FinanceInvoice`
306--
307
308CREATE TABLE IF NOT EXISTS `FinanceInvoice` (
309 `Id` int(11) NOT NULL AUTO_INCREMENT,
310 `BillCode` varchar(16) COLLATE utf8_czech_ci NOT NULL,
311 `Subject` int(11) NOT NULL DEFAULT '0',
312 `TimeCreation` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
313 `TimeDue` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
314 `TimePayment` datetime DEFAULT NULL,
315 `Value` float NOT NULL DEFAULT '0',
316 `File` int(11) DEFAULT NULL,
317 `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
318 `PeriodTo` date DEFAULT NULL,
319 `PeriodFrom` date DEFAULT NULL,
320 PRIMARY KEY (`Id`),
321 KEY `Subject` (`Subject`),
322 KEY `Bill` (`File`)
323) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8773 ;
324
325--
326-- RELACE PRO TABULKU `FinanceInvoice`:
327-- `File`
328-- `File` -> `Id`
329-- `Subject`
330-- `Subject` -> `Id`
331--
332
333-- --------------------------------------------------------
334
335--
336-- Struktura tabulky `FinanceInvoiceItem`
337--
338
339CREATE TABLE IF NOT EXISTS `FinanceInvoiceItem` (
340 `Id` int(11) NOT NULL AUTO_INCREMENT,
341 `FinanceInvoice` int(11) NOT NULL DEFAULT '0',
342 `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL,
343 `Price` float NOT NULL DEFAULT '0',
344 `VAT` float NOT NULL DEFAULT '0',
345 `Quantity` float NOT NULL DEFAULT '1',
346 PRIMARY KEY (`Id`),
347 KEY `FinanceClaimLiability` (`FinanceInvoice`)
348) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8192 ;
349
350--
351-- RELACE PRO TABULKU `FinanceInvoiceItem`:
352-- `FinanceInvoice`
353-- `FinanceInvoice` -> `Id`
354--
355
356-- --------------------------------------------------------
357
358--
359-- Struktura tabulky `FinanceLog`
360--
361
362CREATE TABLE IF NOT EXISTS `FinanceLog` (
363 `Id` int(11) NOT NULL AUTO_INCREMENT,
364 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
365 `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
366 PRIMARY KEY (`Id`)
367) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
368
369-- --------------------------------------------------------
370
371--
372-- Struktura tabulky `FinanceMonthlyOverall`
373--
374
375CREATE TABLE IF NOT EXISTS `FinanceMonthlyOverall` (
376 `Id` int(11) NOT NULL AUTO_INCREMENT,
377 `Money` int(11) NOT NULL DEFAULT '0',
378 `Date` date NOT NULL DEFAULT '0000-00-00',
379 `Administration` int(11) NOT NULL DEFAULT '0',
380 `kWh` int(11) NOT NULL DEFAULT '0',
381 `AdministrationTotal` int(11) NOT NULL DEFAULT '0',
382 `ConsumptionTotal` int(11) NOT NULL DEFAULT '0',
383 `TotalPaid` int(11) NOT NULL DEFAULT '0',
384 `BaseTariffPrice` int(11) NOT NULL DEFAULT '0',
385 `TopTariffPrice` int(11) NOT NULL DEFAULT '0',
386 `MemberCount` int(11) NOT NULL DEFAULT '0',
387 `Investment` int(11) NOT NULL,
388 PRIMARY KEY (`Id`)
389) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=122 ;
390
391-- --------------------------------------------------------
392
393--
394-- Struktura tabulky `FinanceOperation`
395--
396
397CREATE TABLE IF NOT EXISTS `FinanceOperation` (
398 `Id` int(11) NOT NULL AUTO_INCREMENT,
399 `Time` datetime NOT NULL,
400 `Subject` int(11) NOT NULL DEFAULT '0',
401 `Cash` int(11) NOT NULL DEFAULT '0',
402 `Value` float NOT NULL,
403 `BillCode` varchar(32) COLLATE utf8_czech_ci DEFAULT NULL,
404 `Taxable` tinyint(1) NOT NULL DEFAULT '1',
405 `File` int(11) DEFAULT NULL,
406 `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT 'Vklad',
407 `Network` int(11) NOT NULL DEFAULT '1',
408 `BankAccount` int(11) DEFAULT NULL COMMENT 'FinanceBankAccount',
409 `Treasury` int(11) DEFAULT NULL COMMENT 'FinanceTreasury',
410 PRIMARY KEY (`Id`),
411 UNIQUE KEY `BillCode` (`BillCode`),
412 UNIQUE KEY `BillCode_2` (`BillCode`),
413 KEY `Subject` (`Subject`),
414 KEY `Bill` (`File`),
415 KEY `BankAccount` (`BankAccount`),
416 KEY `Treasury` (`Treasury`)
417) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6546 ;
418
419--
420-- RELACE PRO TABULKU `FinanceOperation`:
421-- `File`
422-- `File` -> `Id`
423-- `Subject`
424-- `Subject` -> `Id`
425-- `BankAccount`
426-- `FinanceBankAccount` -> `Id`
427-- `Treasury`
428-- `FinanceTreasury` -> `Id`
429--
430
431-- --------------------------------------------------------
432
433--
434-- Struktura tabulky `FinanceSmallAssets`
435--
436
437CREATE TABLE IF NOT EXISTS `FinanceSmallAssets` (
438 `Id` int(11) NOT NULL AUTO_INCREMENT,
439 `Text` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
440 `PricePurchase` float NOT NULL DEFAULT '0',
441 `TimeEnlistment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
442 `TimeElimination` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
443 `SupplySubject` int(11) NOT NULL DEFAULT '0',
444 `DeviceId` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
445 PRIMARY KEY (`Id`)
446) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
447
448-- --------------------------------------------------------
449
450--
451-- Struktura tabulky `FinanceTreasury`
452--
453
454CREATE TABLE IF NOT EXISTS `FinanceTreasury` (
455 `Id` int(11) NOT NULL AUTO_INCREMENT,
456 `TimeCreate` date NOT NULL,
457 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
458 PRIMARY KEY (`Id`)
459) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2 ;
460
461-- --------------------------------------------------------
462
463--
464-- Struktura tabulky `FinanceYear`
465--
466
467CREATE TABLE IF NOT EXISTS `FinanceYear` (
468 `Id` int(11) NOT NULL AUTO_INCREMENT,
469 `Year` int(11) NOT NULL,
470 `DateStart` date NOT NULL,
471 `DateEnd` date NOT NULL,
472 PRIMARY KEY (`Id`)
473) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=9 ;
474
475-- --------------------------------------------------------
476
477--
478-- Struktura tabulky `HostedProject`
479--
480
481CREATE TABLE IF NOT EXISTS `HostedProject` (
482 `Id` int(11) NOT NULL AUTO_INCREMENT,
483 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
484 `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
485 `User` int(255) NOT NULL COMMENT 'User.Id',
486 `TimeCreate` datetime NOT NULL,
487 `Server` int(11) DEFAULT NULL COMMENT 'NetworkDevice.Id',
488 `Active` int(11) NOT NULL DEFAULT '1',
489 `WebHosting` int(11) NOT NULL,
490 PRIMARY KEY (`Id`)
491) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16 ;
492
493-- --------------------------------------------------------
494
495--
496-- Struktura tabulky `Hyperlink`
497--
498
499CREATE TABLE IF NOT EXISTS `Hyperlink` (
500 `Id` int(11) NOT NULL AUTO_INCREMENT,
501 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
502 `URL` varchar(255) COLLATE utf8_czech_ci NOT NULL,
503 `Group` int(11) NOT NULL,
504 `IconFile` varchar(255) COLLATE utf8_czech_ci NOT NULL,
505 `PermissionModule` varchar(255) COLLATE utf8_czech_ci NOT NULL,
506 `PermissionOperation` varchar(255) COLLATE utf8_czech_ci NOT NULL,
507 `Enable` int(11) NOT NULL DEFAULT '1',
508 PRIMARY KEY (`Id`),
509 KEY `Group` (`Group`),
510 KEY `Enable` (`Enable`)
511) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=70 ;
512
513--
514-- RELACE PRO TABULKU `Hyperlink`:
515-- `Group`
516-- `HyperlinkGroup` -> `Id`
517--
518
519-- --------------------------------------------------------
520
521--
522-- Struktura tabulky `HyperlinkGroup`
523--
524
525CREATE TABLE IF NOT EXISTS `HyperlinkGroup` (
526 `Id` int(11) NOT NULL AUTO_INCREMENT,
527 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
528 PRIMARY KEY (`Id`)
529) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=10 ;
530
531-- --------------------------------------------------------
532
533--
534-- Struktura tabulky `ISMenuItem`
535--
536
537CREATE TABLE IF NOT EXISTS `ISMenuItem` (
538 `Id` int(11) NOT NULL AUTO_INCREMENT,
539 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
540 `Parent` int(11) DEFAULT NULL,
541 `Table` varchar(255) COLLATE utf8_czech_ci NOT NULL,
542 `IconName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
543 PRIMARY KEY (`Id`),
544 KEY `Parent` (`Parent`)
545) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=40 ;
546
547--
548-- RELACE PRO TABULKU `ISMenuItem`:
549-- `Parent`
550-- `ISMenuItem` -> `Id`
551--
552
553-- --------------------------------------------------------
554
555--
556-- Struktura tabulky `Language`
557--
558
559CREATE TABLE IF NOT EXISTS `Language` (
560 `Id` int(11) NOT NULL AUTO_INCREMENT,
561 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
562 PRIMARY KEY (`Id`)
563) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;
564
565-- --------------------------------------------------------
566
567--
568-- Struktura tabulky `Log`
569--
570
571CREATE TABLE IF NOT EXISTS `Log` (
572 `Id` int(11) NOT NULL AUTO_INCREMENT,
573 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
574 `User` int(11) DEFAULT NULL,
575 `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
576 `Operation` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
577 `Value` text COLLATE utf8_czech_ci NOT NULL,
578 PRIMARY KEY (`Id`),
579 KEY `Time` (`Time`),
580 KEY `User` (`User`)
581) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=38283 ;
582
583--
584-- RELACE PRO TABULKU `Log`:
585-- `User`
586-- `User` -> `Id`
587--
588
589-- --------------------------------------------------------
590
591--
592-- Struktura tabulky `MapPosition`
593--
594
595CREATE TABLE IF NOT EXISTS `MapPosition` (
596 `Id` int(11) NOT NULL AUTO_INCREMENT,
597 `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
598 `Latitude` double NOT NULL,
599 `Longitude` double NOT NULL,
600 PRIMARY KEY (`Id`)
601) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=767 ;
602
603-- --------------------------------------------------------
604
605--
606-- Struktura tabulky `Meals`
607--
608
609CREATE TABLE IF NOT EXISTS `Meals` (
610 `Date` date NOT NULL DEFAULT '0000-00-00',
611 `Soup` varchar(255) COLLATE utf8_czech_ci NOT NULL,
612 `Meal` varchar(255) COLLATE utf8_czech_ci NOT NULL,
613 `Status` int(11) NOT NULL DEFAULT '0',
614 UNIQUE KEY `date` (`Date`)
615) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
616
617-- --------------------------------------------------------
618
619--
620-- Struktura tabulky `MealsInfo`
621--
622
623CREATE TABLE IF NOT EXISTS `MealsInfo` (
624 `Info` text COLLATE utf8_czech_ci NOT NULL,
625 `Price` int(11) NOT NULL DEFAULT '0'
626) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci ROW_FORMAT=DYNAMIC;
627
628-- --------------------------------------------------------
629
630--
631-- Struktura tabulky `Member`
632--
633
634CREATE TABLE IF NOT EXISTS `Member` (
635 `Id` int(11) NOT NULL AUTO_INCREMENT,
636 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
637 `Subject` int(11) NOT NULL,
638 `ResponsibleUser` int(11) NOT NULL,
639 `FamilyMemberCount` int(11) NOT NULL,
640 `MembershipDate` date NOT NULL,
641 `MemberState` int(11) NOT NULL,
642 `GPS` int(11) NOT NULL,
643 `BillingPeriod` int(11) NOT NULL DEFAULT '2',
644 `NetworkSegment` int(11) DEFAULT NULL,
645 `BillingPeriodNext` int(11) NOT NULL DEFAULT '2',
646 `BillingPeriodLastDate` date NOT NULL,
647 `Hire` float NOT NULL DEFAULT '0',
648 `Blocked` int(11) NOT NULL DEFAULT '0',
649 `PayDay` int(11) NOT NULL DEFAULT '1',
650 PRIMARY KEY (`Id`),
651 KEY `Subject` (`Subject`),
652 KEY `ResponsibleUser` (`ResponsibleUser`),
653 KEY `BillingPeriod` (`BillingPeriod`),
654 KEY `BillingPeriodNext` (`BillingPeriodNext`),
655 KEY `NetworkSegment` (`NetworkSegment`)
656) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=201 ;
657
658--
659-- RELACE PRO TABULKU `Member`:
660-- `Subject`
661-- `Subject` -> `Id`
662-- `ResponsibleUser`
663-- `User` -> `Id`
664-- `BillingPeriod`
665-- `FinanceBillingPeriod` -> `Id`
666-- `BillingPeriodNext`
667-- `FinanceBillingPeriod` -> `Id`
668--
669
670-- --------------------------------------------------------
671
672--
673-- Struktura tabulky `MemberPayment`
674--
675
676CREATE TABLE IF NOT EXISTS `MemberPayment` (
677 `Id` int(11) NOT NULL AUTO_INCREMENT,
678 `Member` int(11) NOT NULL,
679 `MonthlyTotal` float NOT NULL,
680 `MonthlyInternet` float NOT NULL,
681 `MonthlyConsumption` float NOT NULL,
682 `NetworkDevice` float NOT NULL,
683 `MonthlyPlus` float NOT NULL,
684 `Cash` float NOT NULL,
685 PRIMARY KEY (`Id`),
686 KEY `Member` (`Member`)
687) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=183 ;
688
689--
690-- RELACE PRO TABULKU `MemberPayment`:
691-- `Member`
692-- `Member` -> `Id`
693--
694
695-- --------------------------------------------------------
696
697--
698-- Struktura tabulky `MeteoStation`
699--
700
701CREATE TABLE IF NOT EXISTS `MeteoStation` (
702 `Id` int(11) NOT NULL AUTO_INCREMENT,
703 `Name` varchar(255) NOT NULL,
704 `URL` varchar(255) NOT NULL,
705 `Enabled` tinyint(1) NOT NULL,
706 `Period` int(11) NOT NULL,
707 `Model` varchar(255) NOT NULL,
708 PRIMARY KEY (`Id`)
709) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
710
711-- --------------------------------------------------------
712
713--
714-- Struktura tabulky `MeteoStationMeasure`
715--
716
717CREATE TABLE IF NOT EXISTS `MeteoStationMeasure` (
718 `Id` int(11) NOT NULL AUTO_INCREMENT,
719 `Time` datetime NOT NULL,
720 `MeteoStation` int(11) NOT NULL,
721 `WindSpeed` float NOT NULL,
722 `WindDir` float NOT NULL,
723 `WindGust` float NOT NULL,
724 `Pressure` float NOT NULL,
725 `SysTemp` float NOT NULL,
726 `Temperature` float NOT NULL,
727 `BarAltitude` float NOT NULL,
728 `WindChill` float NOT NULL,
729 `RelHumidity` float NOT NULL,
730 `AbsHumidity` float NOT NULL,
731 `DewPoint` float NOT NULL,
732 PRIMARY KEY (`Id`),
733 KEY `MeteoStation` (`MeteoStation`)
734) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
735
736--
737-- RELACE PRO TABULKU `MeteoStationMeasure`:
738-- `MeteoStation`
739-- `MeteoStation` -> `Id`
740--
741
742-- --------------------------------------------------------
743
744--
745-- Struktura tabulky `NetworkAP`
746--
747
748CREATE TABLE IF NOT EXISTS `NetworkAP` (
749 `Id` int(11) NOT NULL AUTO_INCREMENT,
750 `SSID` varchar(255) COLLATE utf8_czech_ci NOT NULL,
751 `Frequency` int(11) NOT NULL,
752 `ChannelWidth` int(11) NOT NULL DEFAULT '20',
753 `NetworkDevice` int(11) DEFAULT NULL,
754 PRIMARY KEY (`Id`),
755 KEY `NetworkDevice` (`NetworkDevice`)
756) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=45 ;
757
758--
759-- RELACE PRO TABULKU `NetworkAP`:
760-- `NetworkDevice`
761-- `NetworkDevice` -> `Id`
762--
763
764-- --------------------------------------------------------
765
766--
767-- Struktura tabulky `NetworkConfiguration`
768--
769
770CREATE TABLE IF NOT EXISTS `NetworkConfiguration` (
771 `Id` int(11) NOT NULL AUTO_INCREMENT,
772 `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
773 `Execute` varchar(255) COLLATE utf8_czech_ci NOT NULL,
774 `Changed` int(11) NOT NULL DEFAULT '0',
775 `LastTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
776 `ExecutionTime` int(11) NOT NULL,
777 `Enabled` int(11) NOT NULL DEFAULT '1',
778 `Period` int(11) NOT NULL DEFAULT '60',
779 `Log` mediumtext COLLATE utf8_czech_ci NOT NULL,
780 PRIMARY KEY (`Id`)
781) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;
782
783-- --------------------------------------------------------
784
785--
786-- Struktura tabulky `NetworkDevice`
787--
788
789CREATE TABLE IF NOT EXISTS `NetworkDevice` (
790 `Id` int(11) NOT NULL AUTO_INCREMENT,
791 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
792 `Member` int(11) NOT NULL COMMENT 'Member',
793 `Location` int(11) NOT NULL COMMENT 'Member',
794 `Type` int(11) NOT NULL COMMENT 'NetworkDeviceType',
795 `Used` int(11) NOT NULL DEFAULT '1',
796 `Online` int(11) NOT NULL DEFAULT '0',
797 `LastOnline` datetime NOT NULL,
798 `PermanentOnline` int(11) NOT NULL DEFAULT '0',
799 `InboundNATPriority` int(11) NOT NULL DEFAULT '1',
800 `MapPosition` int(11) DEFAULT NULL,
801 PRIMARY KEY (`Id`),
802 UNIQUE KEY `Name` (`Name`),
803 KEY `Member` (`Member`),
804 KEY `Location` (`Location`),
805 KEY `Type` (`Type`),
806 KEY `MapPosition` (`MapPosition`)
807) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=645 ;
808
809--
810-- RELACE PRO TABULKU `NetworkDevice`:
811-- `Member`
812-- `Member` -> `Id`
813-- `Location`
814-- `Member` -> `Id`
815-- `Type`
816-- `NetworkDeviceType` -> `Id`
817-- `MapPosition`
818-- `MapPosition` -> `Id`
819--
820
821-- --------------------------------------------------------
822
823--
824-- Struktura tabulky `NetworkDeviceConfig`
825--
826
827CREATE TABLE IF NOT EXISTS `NetworkDeviceConfig` (
828 `Id` int(11) NOT NULL AUTO_INCREMENT,
829 `Device` int(11) NOT NULL,
830 `Time` date NOT NULL,
831 `ConfigFull` mediumtext NOT NULL,
832 `ConfigCompact` mediumtext NOT NULL,
833 PRIMARY KEY (`Id`),
834 KEY `Time` (`Time`),
835 KEY `Device` (`Device`)
836) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
837
838--
839-- RELACE PRO TABULKU `NetworkDeviceConfig`:
840-- `Device`
841-- `NetworkDevice` -> `Id`
842--
843
844-- --------------------------------------------------------
845
846--
847-- Struktura tabulky `NetworkDeviceHistory`
848--
849
850CREATE TABLE IF NOT EXISTS `NetworkDeviceHistory` (
851 `Id` int(11) NOT NULL AUTO_INCREMENT,
852 `Device` int(11) NOT NULL DEFAULT '0',
853 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
854 `Action` int(11) NOT NULL DEFAULT '0',
855 `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
856 PRIMARY KEY (`Id`),
857 KEY `Device` (`Device`)
858) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
859
860-- --------------------------------------------------------
861
862--
863-- Struktura tabulky `NetworkDeviceType`
864--
865
866CREATE TABLE IF NOT EXISTS `NetworkDeviceType` (
867 `Id` int(11) NOT NULL AUTO_INCREMENT,
868 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
869 `ShowOnline` int(11) NOT NULL DEFAULT '0',
870 `IconName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
871 PRIMARY KEY (`Id`)
872) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
873
874-- --------------------------------------------------------
875
876--
877-- Struktura tabulky `NetworkDomainAlias`
878--
879
880CREATE TABLE IF NOT EXISTS `NetworkDomainAlias` (
881 `Id` int(11) NOT NULL AUTO_INCREMENT,
882 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
883 `Target` varchar(255) COLLATE utf8_czech_ci NOT NULL,
884 `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
885 PRIMARY KEY (`Id`),
886 UNIQUE KEY `Name` (`Name`,`Target`),
887 UNIQUE KEY `Name_2` (`Name`,`Target`)
888) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=39 ;
889
890-- --------------------------------------------------------
891
892--
893-- Struktura tabulky `NetworkFirewall`
894--
895
896CREATE TABLE IF NOT EXISTS `NetworkFirewall` (
897 `Id` int(11) NOT NULL AUTO_INCREMENT,
898 `NetworkDevice` int(11) NOT NULL,
899 `SourceInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
900 `DestinationInterface` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
901 `SourceAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
902 `DestinationAddress` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
903 `SourcePort` int(11) DEFAULT NULL,
904 `DestinationPort` int(11) DEFAULT NULL,
905 `Action` varchar(255) COLLATE utf8_czech_ci NOT NULL,
906 `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
907 PRIMARY KEY (`Id`),
908 KEY `NetworkDevice` (`NetworkDevice`)
909) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;
910
911--
912-- RELACE PRO TABULKU `NetworkFirewall`:
913-- `NetworkDevice`
914-- `NetworkDevice` -> `Id`
915--
916
917-- --------------------------------------------------------
918
919--
920-- Struktura tabulky `NetworkInterface`
921--
922
923CREATE TABLE IF NOT EXISTS `NetworkInterface` (
924 `Id` int(11) NOT NULL AUTO_INCREMENT,
925 `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
926 `Type` int(11) NOT NULL,
927 `MAC` varchar(17) COLLATE utf8_czech_ci NOT NULL,
928 `LocalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
929 `IPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
930 `ExternalIP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
931 `Device` int(11) NOT NULL,
932 `Online` int(11) NOT NULL DEFAULT '0',
933 `LastOnline` datetime NOT NULL,
934 PRIMARY KEY (`Id`),
935 KEY `Device` (`Device`),
936 KEY `Type` (`Type`)
937) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=712 ;
938
939--
940-- RELACE PRO TABULKU `NetworkInterface`:
941-- `Type`
942-- `NetworkInterfaceType` -> `Id`
943-- `Device`
944-- `NetworkDevice` -> `Id`
945--
946
947-- --------------------------------------------------------
948
949--
950-- Struktura tabulky `NetworkInterfacePortable`
951--
952
953CREATE TABLE IF NOT EXISTS `NetworkInterfacePortable` (
954 `Id` int(11) NOT NULL AUTO_INCREMENT,
955 `NetworkInterface` int(11) NOT NULL,
956 `DynamicIP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
957 `Time` datetime NOT NULL,
958 `Update` int(11) NOT NULL,
959 PRIMARY KEY (`Id`),
960 KEY `NetworkInterface` (`NetworkInterface`),
961 KEY `Update` (`Update`)
962) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ;
963
964-- --------------------------------------------------------
965
966--
967-- Struktura tabulky `NetworkInterfaceStat`
968--
969
970CREATE TABLE IF NOT EXISTS `NetworkInterfaceStat` (
971 `NetworkInterface` int(11) NOT NULL DEFAULT '0',
972 `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
973 `PingCount` smallint(11) NOT NULL DEFAULT '0',
974 KEY `host_id` (`NetworkInterface`),
975 KEY `time` (`Time`)
976) ENGINE=MyISAM DEFAULT CHARSET=utf8;
977
978-- --------------------------------------------------------
979
980--
981-- Struktura tabulky `NetworkInterfaceType`
982--
983
984CREATE TABLE IF NOT EXISTS `NetworkInterfaceType` (
985 `Id` int(11) NOT NULL AUTO_INCREMENT,
986 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
987 `MaxSpeed` int(11) NOT NULL,
988 `FullDuplex` int(11) NOT NULL DEFAULT '1',
989 `Color` varchar(6) COLLATE utf8_czech_ci NOT NULL DEFAULT 'ffffff',
990 PRIMARY KEY (`Id`)
991) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=8 ;
992
993-- --------------------------------------------------------
994
995--
996-- Struktura tabulky `NetworkLink`
997--
998
999CREATE TABLE IF NOT EXISTS `NetworkLink` (
1000 `Id` int(11) NOT NULL AUTO_INCREMENT,
1001 `Type` int(11) NOT NULL,
1002 `Interface1` int(11) NOT NULL,
1003 `Interface2` int(11) NOT NULL,
1004 PRIMARY KEY (`Id`),
1005 KEY `Interface1` (`Interface1`),
1006 KEY `Interface2` (`Interface2`)
1007) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=356 ;
1008
1009--
1010-- RELACE PRO TABULKU `NetworkLink`:
1011-- `Interface2`
1012-- `NetworkInterface` -> `Id`
1013-- `Interface1`
1014-- `NetworkInterface` -> `Id`
1015--
1016
1017-- --------------------------------------------------------
1018
1019--
1020-- Struktura tabulky `NetworkMangleSubgroup`
1021--
1022
1023CREATE TABLE IF NOT EXISTS `NetworkMangleSubgroup` (
1024 `Id` int(11) NOT NULL AUTO_INCREMENT,
1025 `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1026 PRIMARY KEY (`Id`),
1027 KEY `AddressRange` (`AddressRange`)
1028) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=147 ;
1029
1030-- --------------------------------------------------------
1031
1032--
1033-- Struktura tabulky `NetworkMark`
1034--
1035
1036CREATE TABLE IF NOT EXISTS `NetworkMark` (
1037 `Id` int(11) NOT NULL AUTO_INCREMENT,
1038 `Comment` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1039 PRIMARY KEY (`Id`),
1040 KEY `Comment` (`Comment`)
1041) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1430 ;
1042
1043-- --------------------------------------------------------
1044
1045--
1046-- Struktura tabulky `NetworkSegment`
1047--
1048
1049CREATE TABLE IF NOT EXISTS `NetworkSegment` (
1050 `Id` int(11) NOT NULL AUTO_INCREMENT,
1051 `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
1052 `Price` int(11) NOT NULL DEFAULT '0',
1053 `Parent` int(11) DEFAULT '0',
1054 `Users` int(11) NOT NULL DEFAULT '0',
1055 `Consumption` int(11) NOT NULL DEFAULT '0',
1056 `UsersOverheads` int(11) NOT NULL DEFAULT '0',
1057 PRIMARY KEY (`Id`),
1058 KEY `Parent` (`Parent`)
1059) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=33 ;
1060
1061--
1062-- RELACE PRO TABULKU `NetworkSegment`:
1063-- `Parent`
1064-- `NetworkSegment` -> `Id`
1065--
1066
1067-- --------------------------------------------------------
1068
1069--
1070-- Struktura tabulky `NetworkSubnet`
1071--
1072
1073CREATE TABLE IF NOT EXISTS `NetworkSubnet` (
1074 `Id` int(11) NOT NULL AUTO_INCREMENT,
1075 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1076 `AddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1077 `Mask` int(11) NOT NULL,
1078 `DHCP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1079 `Gateway` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1080 `WINS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1081 `DNS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1082 `Domain` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1083 `NTP` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1084 `Member` int(11) DEFAULT NULL,
1085 `ExtAddressRange` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1086 `ExtMask` int(11) NOT NULL DEFAULT '32',
1087 `AddressRangeIPv6` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1088 `Configure` int(11) NOT NULL DEFAULT '1',
1089 PRIMARY KEY (`Id`),
1090 KEY `Member` (`Member`),
1091 KEY `Configure` (`Configure`)
1092) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=44 ;
1093
1094--
1095-- RELACE PRO TABULKU `NetworkSubnet`:
1096-- `Member`
1097-- `Member` -> `Id`
1098--
1099
1100-- --------------------------------------------------------
1101
1102--
1103-- Struktura tabulky `NetworkTopology`
1104--
1105
1106CREATE TABLE IF NOT EXISTS `NetworkTopology` (
1107 `Host` int(11) NOT NULL DEFAULT '0',
1108 `Depth` int(11) NOT NULL DEFAULT '0',
1109 `Pos` int(11) NOT NULL DEFAULT '0',
1110 `First` int(11) NOT NULL DEFAULT '0',
1111 `Last` int(11) NOT NULL DEFAULT '0',
1112 PRIMARY KEY (`Host`)
1113) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
1114
1115-- --------------------------------------------------------
1116
1117--
1118-- Struktura tabulky `News`
1119--
1120
1121CREATE TABLE IF NOT EXISTS `News` (
1122 `Id` int(11) NOT NULL AUTO_INCREMENT,
1123 `Title` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1124 `Content` text COLLATE utf8_czech_ci NOT NULL,
1125 `Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1126 `TargetDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1127 `Author` varchar(32) COLLATE utf8_czech_ci NOT NULL,
1128 `IP` varchar(16) COLLATE utf8_czech_ci NOT NULL,
1129 `Category` int(11) DEFAULT '0',
1130 `Enclosure` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1131 `User` int(11) DEFAULT NULL,
1132 `Link` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1133 PRIMARY KEY (`Id`),
1134 KEY `category` (`Category`),
1135 KEY `date` (`Date`),
1136 KEY `Title` (`Title`),
1137 KEY `Link` (`Link`),
1138 KEY `User` (`User`)
1139) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=973387 ;
1140
1141--
1142-- RELACE PRO TABULKU `News`:
1143-- `Category`
1144-- `NewsCategory` -> `Id`
1145-- `User`
1146-- `User` -> `Id`
1147--
1148
1149-- --------------------------------------------------------
1150
1151--
1152-- Struktura tabulky `NewsCategory`
1153--
1154
1155CREATE TABLE IF NOT EXISTS `NewsCategory` (
1156 `Id` int(11) NOT NULL AUTO_INCREMENT,
1157 `Caption` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1158 `Permission` int(11) NOT NULL DEFAULT '0',
1159 `Sequence` int(11) NOT NULL,
1160 `Group` int(11) NOT NULL DEFAULT '1',
1161 `RSS` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1162 PRIMARY KEY (`Id`),
1163 KEY `Sequence` (`Sequence`),
1164 KEY `Group` (`Group`)
1165) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=17 ;
1166
1167-- --------------------------------------------------------
1168
1169--
1170-- Struktura tabulky `Panel`
1171--
1172
1173CREATE TABLE IF NOT EXISTS `Panel` (
1174 `Id` int(11) NOT NULL AUTO_INCREMENT,
1175 `Module` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1176 `Parameters` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1177 `Order` int(11) NOT NULL,
1178 `PanelColumn` int(11) NOT NULL,
1179 PRIMARY KEY (`Id`),
1180 KEY `PanelColumn` (`PanelColumn`)
1181) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=14 ;
1182
1183--
1184-- RELACE PRO TABULKU `Panel`:
1185-- `PanelColumn`
1186-- `PanelColumn` -> `Id`
1187--
1188
1189-- --------------------------------------------------------
1190
1191--
1192-- Struktura tabulky `PanelColumn`
1193--
1194
1195CREATE TABLE IF NOT EXISTS `PanelColumn` (
1196 `Id` int(11) NOT NULL AUTO_INCREMENT,
1197 `Width` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1198 PRIMARY KEY (`Id`)
1199) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
1200
1201-- --------------------------------------------------------
1202
1203--
1204-- Struktura tabulky `PermissionGroup`
1205--
1206
1207CREATE TABLE IF NOT EXISTS `PermissionGroup` (
1208 `Id` int(11) NOT NULL AUTO_INCREMENT,
1209 `Description` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1210 PRIMARY KEY (`Id`)
1211) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=6 ;
1212
1213-- --------------------------------------------------------
1214
1215--
1216-- Struktura tabulky `PermissionGroupAssignment`
1217--
1218
1219CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` (
1220 `Id` int(11) NOT NULL AUTO_INCREMENT,
1221 `Group` int(11) NOT NULL DEFAULT '0',
1222 `AssignedGroup` int(11) DEFAULT NULL,
1223 `AssignedOperation` int(11) DEFAULT NULL,
1224 PRIMARY KEY (`Id`),
1225 KEY `Group` (`Group`),
1226 KEY `AssignedGroup` (`AssignedGroup`),
1227 KEY `AssignedOperation` (`AssignedOperation`)
1228) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=48 ;
1229
1230--
1231-- RELACE PRO TABULKU `PermissionGroupAssignment`:
1232-- `Group`
1233-- `PermissionGroup` -> `Id`
1234-- `AssignedGroup`
1235-- `PermissionGroup` -> `Id`
1236-- `AssignedOperation`
1237-- `PermissionOperation` -> `Id`
1238--
1239
1240-- --------------------------------------------------------
1241
1242--
1243-- Struktura tabulky `PermissionOperation`
1244--
1245
1246CREATE TABLE IF NOT EXISTS `PermissionOperation` (
1247 `Id` int(11) NOT NULL AUTO_INCREMENT,
1248 `Module` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1249 `Operation` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1250 `Item` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1251 `ItemId` int(11) NOT NULL DEFAULT '0',
1252 PRIMARY KEY (`Id`),
1253 KEY `Module` (`Module`),
1254 KEY `Operation` (`Operation`),
1255 KEY `Item` (`Item`),
1256 KEY `ItemId` (`ItemId`)
1257) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=45 ;
1258
1259-- --------------------------------------------------------
1260
1261--
1262-- Struktura tabulky `PermissionUserAssignment`
1263--
1264
1265CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` (
1266 `Id` int(11) NOT NULL AUTO_INCREMENT,
1267 `User` int(11) NOT NULL DEFAULT '0',
1268 `AssignedGroup` int(11) DEFAULT NULL,
1269 `AssignedOperation` int(11) DEFAULT NULL,
1270 PRIMARY KEY (`Id`),
1271 KEY `User` (`User`),
1272 KEY `AssignedGroup` (`AssignedGroup`),
1273 KEY `AssignedOperation` (`AssignedOperation`)
1274) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=227 ;
1275
1276--
1277-- RELACE PRO TABULKU `PermissionUserAssignment`:
1278-- `User`
1279-- `User` -> `Id`
1280-- `AssignedGroup`
1281-- `PermissionGroup` -> `Id`
1282-- `AssignedOperation`
1283-- `PermissionOperation` -> `Id`
1284--
1285
1286-- --------------------------------------------------------
1287
1288--
1289-- Struktura tabulky `PhoneBook`
1290--
1291
1292CREATE TABLE IF NOT EXISTS `PhoneBook` (
1293 `Id` int(11) NOT NULL AUTO_INCREMENT,
1294 `Number` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1295 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1296 `Address` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1297 `LastUpdate` datetime NOT NULL,
1298 `Operator` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1299 PRIMARY KEY (`Id`)
1300) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=53 ;
1301
1302-- --------------------------------------------------------
1303
1304--
1305-- Struktura tabulky `Product`
1306--
1307
1308CREATE TABLE IF NOT EXISTS `Product` (
1309 `Id` int(11) NOT NULL AUTO_INCREMENT,
1310 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1311 `SellPrice` float NOT NULL,
1312 `BuyPrice` float NOT NULL,
1313 `VAT` float DEFAULT NULL,
1314 `Consumption` int(11) DEFAULT NULL COMMENT 'In Watts',
1315 `Supplier` int(11) DEFAULT NULL COMMENT 'Subject',
1316 `Manufacturer` int(11) DEFAULT NULL,
1317 `Code` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
1318 `UnitOfMeasure` int(11) NOT NULL,
1319 PRIMARY KEY (`Id`),
1320 UNIQUE KEY `Code` (`Code`),
1321 KEY `Supplier` (`Supplier`),
1322 KEY `UnitOfMeasure` (`UnitOfMeasure`),
1323 KEY `Manufacturer` (`Manufacturer`)
1324) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=181 ;
1325
1326--
1327-- RELACE PRO TABULKU `Product`:
1328-- `Supplier`
1329-- `Subject` -> `Id`
1330-- `Manufacturer`
1331-- `Subject` -> `Id`
1332-- `UnitOfMeasure`
1333-- `UnitOfMeasure` -> `Id`
1334--
1335
1336-- --------------------------------------------------------
1337
1338--
1339-- Struktura tabulky `Service`
1340--
1341
1342CREATE TABLE IF NOT EXISTS `Service` (
1343 `Id` int(11) NOT NULL AUTO_INCREMENT,
1344 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1345 `Category` int(11) NOT NULL,
1346 `Price` int(11) NOT NULL,
1347 `CustomerCount` int(11) NOT NULL,
1348 `ReplaceId` int(11) DEFAULT NULL,
1349 `Public` int(11) NOT NULL,
1350 `InternetSpeedMin` int(11) NOT NULL,
1351 `InternetSpeedMax` int(11) NOT NULL,
1352 `UploadAsymmetry` int(11) NOT NULL,
1353 `Memory` int(11) NOT NULL,
1354 `MemorySwap` int(11) NOT NULL,
1355 `Storage` int(11) NOT NULL,
1356 `CPUCount` int(11) NOT NULL,
1357 PRIMARY KEY (`Id`),
1358 KEY `Category` (`Category`),
1359 KEY `Public` (`Public`),
1360 KEY `ReplaceId` (`ReplaceId`)
1361) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=16 ;
1362
1363--
1364-- RELACE PRO TABULKU `Service`:
1365-- `ReplaceId`
1366-- `Service` -> `Id`
1367-- `Category`
1368-- `ServiceCategory` -> `Id`
1369--
1370
1371-- --------------------------------------------------------
1372
1373--
1374-- Struktura tabulky `ServiceCategory`
1375--
1376
1377CREATE TABLE IF NOT EXISTS `ServiceCategory` (
1378 `Id` int(11) NOT NULL AUTO_INCREMENT,
1379 `Name` varchar(255) NOT NULL,
1380 PRIMARY KEY (`Id`)
1381) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
1382
1383-- --------------------------------------------------------
1384
1385--
1386-- Struktura tabulky `ServiceCustomerRel`
1387--
1388
1389CREATE TABLE IF NOT EXISTS `ServiceCustomerRel` (
1390 `Id` int(11) NOT NULL AUTO_INCREMENT,
1391 `Service` int(11) NOT NULL,
1392 `Customer` int(11) NOT NULL,
1393 `Period` int(11) NOT NULL,
1394 PRIMARY KEY (`Id`),
1395 KEY `Service` (`Service`),
1396 KEY `Customer` (`Customer`)
1397) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=511 ;
1398
1399--
1400-- RELACE PRO TABULKU `ServiceCustomerRel`:
1401-- `Service`
1402-- `Service` -> `Id`
1403-- `Customer`
1404-- `Member` -> `Id`
1405--
1406
1407-- --------------------------------------------------------
1408
1409--
1410-- Struktura tabulky `Stock`
1411--
1412
1413CREATE TABLE IF NOT EXISTS `Stock` (
1414 `Id` int(11) NOT NULL AUTO_INCREMENT,
1415 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1416 `Location` int(11) DEFAULT NULL,
1417 PRIMARY KEY (`Id`),
1418 KEY `Location` (`Location`)
1419) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
1420
1421--
1422-- RELACE PRO TABULKU `Stock`:
1423-- `Location`
1424-- `Member` -> `Id`
1425--
1426
1427-- --------------------------------------------------------
1428
1429--
1430-- Struktura tabulky `StockItem`
1431--
1432
1433CREATE TABLE IF NOT EXISTS `StockItem` (
1434 `Id` int(11) NOT NULL AUTO_INCREMENT,
1435 `Stock` int(11) NOT NULL,
1436 `Product` int(11) NOT NULL,
1437 `TimeEnlistment` date NOT NULL,
1438 `TimeElimination` date DEFAULT NULL,
1439 `BuyPrice` decimal(10,0) NOT NULL,
1440 `SellPrice` decimal(10,0) NOT NULL,
1441 `Amount` float NOT NULL,
1442 `SerialNumber` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
1443 `RegNumber` varchar(255) COLLATE utf8_czech_ci DEFAULT NULL,
1444 `Location` int(11) DEFAULT NULL COMMENT 'Member',
1445 `Segment` int(11) DEFAULT NULL,
1446 `Info` text COLLATE utf8_czech_ci NOT NULL,
1447 PRIMARY KEY (`Id`),
1448 UNIQUE KEY `SerialNumber` (`SerialNumber`),
1449 UNIQUE KEY `RegNumber` (`RegNumber`),
1450 KEY `Product` (`Product`),
1451 KEY `Stock` (`Stock`),
1452 KEY `Segment` (`Segment`),
1453 KEY `Location` (`Location`)
1454) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=186 ;
1455
1456--
1457-- RELACE PRO TABULKU `StockItem`:
1458-- `Stock`
1459-- `Stock` -> `Id`
1460-- `Location`
1461-- `Member` -> `Id`
1462-- `Product`
1463-- `Product` -> `Id`
1464-- `Segment`
1465-- `NetworkSegment` -> `Id`
1466--
1467
1468-- --------------------------------------------------------
1469
1470--
1471-- Struktura tabulky `Subject`
1472--
1473
1474CREATE TABLE IF NOT EXISTS `Subject` (
1475 `Id` int(11) NOT NULL AUTO_INCREMENT,
1476 `Name` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1477 `AddressStreet` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1478 `AddressTown` varchar(64) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1479 `AddressPSC` int(11) NOT NULL DEFAULT '0',
1480 `AddressCountry` int(11) NOT NULL,
1481 `IC` varchar(32) COLLATE utf8_czech_ci NOT NULL,
1482 `DIC` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1483 `PayVAT` int(11) NOT NULL,
1484 `MapPosition` int(11) DEFAULT NULL,
1485 `WWW` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1486 `Note` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1487 PRIMARY KEY (`Id`),
1488 KEY `AddressCountry` (`AddressCountry`),
1489 KEY `MapPosition` (`MapPosition`)
1490) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=233 ;
1491
1492--
1493-- RELACE PRO TABULKU `Subject`:
1494-- `MapPosition`
1495-- `MapPosition` -> `Id`
1496-- `AddressCountry`
1497-- `Country` -> `Id`
1498--
1499
1500-- --------------------------------------------------------
1501
1502--
1503-- Struktura tabulky `SubjectOpenTime`
1504--
1505
1506CREATE TABLE IF NOT EXISTS `SubjectOpenTime` (
1507 `Subject` int(11) NOT NULL DEFAULT '0',
1508 `UpdateTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1509 `Notice` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1510 `Photo` int(11) NOT NULL,
1511 KEY `Subject` (`Subject`)
1512) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
1513
1514--
1515-- RELACE PRO TABULKU `SubjectOpenTime`:
1516-- `Subject`
1517-- `Subject` -> `Id`
1518--
1519
1520-- --------------------------------------------------------
1521
1522--
1523-- Struktura tabulky `SubjectOpenTimeDay`
1524--
1525
1526CREATE TABLE IF NOT EXISTS `SubjectOpenTimeDay` (
1527 `Subject` int(11) NOT NULL,
1528 `Day` int(11) NOT NULL,
1529 `Open1` int(11) NOT NULL,
1530 `Close1` int(11) NOT NULL,
1531 `Open2` int(11) NOT NULL,
1532 `Close2` int(11) NOT NULL,
1533 KEY `Subject` (`Subject`)
1534) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
1535
1536--
1537-- RELACE PRO TABULKU `SubjectOpenTimeDay`:
1538-- `Subject`
1539-- `Subject` -> `Id`
1540--
1541
1542-- --------------------------------------------------------
1543
1544--
1545-- Struktura tabulky `SystemVersion`
1546--
1547
1548CREATE TABLE IF NOT EXISTS `SystemVersion` (
1549 `Id` int(11) NOT NULL AUTO_INCREMENT,
1550 `Revision` int(11) NOT NULL,
1551 PRIMARY KEY (`Id`)
1552) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
1553
1554-- --------------------------------------------------------
1555
1556--
1557-- Struktura tabulky `Task`
1558--
1559
1560CREATE TABLE IF NOT EXISTS `Task` (
1561 `Id` int(11) NOT NULL AUTO_INCREMENT,
1562 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1563 `Description` text COLLATE utf8_czech_ci NOT NULL,
1564 `TimeCreate` date NOT NULL,
1565 `TimeDue` date DEFAULT NULL,
1566 `TimeClose` date DEFAULT NULL,
1567 `Priority` int(11) NOT NULL,
1568 `Conclusion` text COLLATE utf8_czech_ci NOT NULL,
1569 `Public` int(11) NOT NULL,
1570 `Progress` int(11) NOT NULL,
1571 `Group` int(11) DEFAULT NULL,
1572 `AssignedTo` int(11) DEFAULT NULL,
1573 PRIMARY KEY (`Id`),
1574 KEY `Group` (`Group`),
1575 KEY `AssignedTo` (`AssignedTo`)
1576) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
1577
1578--
1579-- RELACE PRO TABULKU `Task`:
1580-- `Group`
1581-- `TaskGroup` -> `Id`
1582-- `AssignedTo`
1583-- `User` -> `Id`
1584--
1585
1586-- --------------------------------------------------------
1587
1588--
1589-- Struktura tabulky `TaskGroup`
1590--
1591
1592CREATE TABLE IF NOT EXISTS `TaskGroup` (
1593 `Id` int(11) NOT NULL AUTO_INCREMENT,
1594 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1595 `Description` text COLLATE utf8_czech_ci NOT NULL,
1596 `Parent` int(11) DEFAULT NULL,
1597 PRIMARY KEY (`Id`),
1598 KEY `Parent` (`Parent`)
1599) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ;
1600
1601--
1602-- RELACE PRO TABULKU `TaskGroup`:
1603-- `Parent`
1604-- `TaskGroup` -> `Id`
1605--
1606
1607-- --------------------------------------------------------
1608
1609--
1610-- Struktura tabulky `TV`
1611--
1612
1613CREATE TABLE IF NOT EXISTS `TV` (
1614 `Id` int(11) NOT NULL AUTO_INCREMENT,
1615 `Name` varchar(16) COLLATE utf8_czech_ci NOT NULL,
1616 `Frequency` int(11) NOT NULL DEFAULT '0',
1617 `Norm` varchar(8) COLLATE utf8_czech_ci NOT NULL,
1618 `Homepage` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1619 `Language` int(11) DEFAULT NULL,
1620 `ShortName` varchar(16) COLLATE utf8_czech_ci NOT NULL,
1621 `Stream` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1622 `StreamWeb` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1623 `SourceType` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1624 `Category` int(11) DEFAULT NULL,
1625 PRIMARY KEY (`Id`),
1626 UNIQUE KEY `ShortName` (`ShortName`),
1627 KEY `Language` (`Language`),
1628 KEY `Category` (`Category`)
1629) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=46 ;
1630
1631--
1632-- RELACE PRO TABULKU `TV`:
1633-- `Language`
1634-- `Language` -> `Id`
1635-- `Category`
1636-- `TVGroup` -> `Id`
1637--
1638
1639-- --------------------------------------------------------
1640
1641--
1642-- Struktura tabulky `TVGroup`
1643--
1644
1645CREATE TABLE IF NOT EXISTS `TVGroup` (
1646 `Id` int(11) NOT NULL AUTO_INCREMENT,
1647 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1648 PRIMARY KEY (`Id`)
1649) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=7 ;
1650
1651-- --------------------------------------------------------
1652
1653--
1654-- Struktura tabulky `UnitOfMeasure`
1655--
1656
1657CREATE TABLE IF NOT EXISTS `UnitOfMeasure` (
1658 `Id` int(11) NOT NULL AUTO_INCREMENT,
1659 `Unit` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1660 `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1661 PRIMARY KEY (`Id`)
1662) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
1663
1664-- --------------------------------------------------------
1665
1666--
1667-- Struktura tabulky `User`
1668--
1669
1670CREATE TABLE IF NOT EXISTS `User` (
1671 `Id` int(11) NOT NULL AUTO_INCREMENT,
1672 `Login` varchar(64) COLLATE utf8_czech_ci NOT NULL,
1673 `Name` varchar(128) COLLATE utf8_czech_ci NOT NULL,
1674 `Password` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1675 `Salt` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1676 `Email` varchar(128) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1677 `LastIpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1678 `LastLoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1679 `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1680 `Locked` tinyint(1) NOT NULL DEFAULT '0',
1681 `ICQ` int(11) NOT NULL DEFAULT '0',
1682 `PhoneNumber` varchar(32) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1683 `InitPassword` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1684 PRIMARY KEY (`Id`),
1685 UNIQUE KEY `Name` (`Login`),
1686 UNIQUE KEY `Nick` (`Name`)
1687) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=253 ;
1688
1689-- --------------------------------------------------------
1690
1691--
1692-- Struktura tabulky `UserCustomerRel`
1693--
1694
1695CREATE TABLE IF NOT EXISTS `UserCustomerRel` (
1696 `Id` int(11) NOT NULL AUTO_INCREMENT,
1697 `Customer` int(11) NOT NULL,
1698 `User` int(11) NOT NULL,
1699 PRIMARY KEY (`Id`),
1700 KEY `Customer` (`Customer`),
1701 KEY `User` (`User`)
1702) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=521 ;
1703
1704--
1705-- RELACE PRO TABULKU `UserCustomerRel`:
1706-- `Customer`
1707-- `Member` -> `Id`
1708-- `User`
1709-- `User` -> `Id`
1710--
1711
1712-- --------------------------------------------------------
1713
1714--
1715-- Struktura tabulky `UserOnline`
1716--
1717
1718CREATE TABLE IF NOT EXISTS `UserOnline` (
1719 `Id` int(11) NOT NULL AUTO_INCREMENT,
1720 `User` int(11) DEFAULT NULL COMMENT 'User.Id',
1721 `ActivityTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1722 `LoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
1723 `SessionId` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1724 `IpAddress` varchar(16) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1725 `HostName` varchar(255) COLLATE utf8_czech_ci NOT NULL DEFAULT '',
1726 `ScriptName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
1727 PRIMARY KEY (`Id`),
1728 KEY `User` (`User`)
1729) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=2430 ;
1730
1731-- --------------------------------------------------------
1732
1733--
1734-- Struktura tabulky `Work`
1735--
1736
1737CREATE TABLE IF NOT EXISTS `Work` (
1738 `Id` int(11) NOT NULL AUTO_INCREMENT,
1739 `Name` varchar(255) NOT NULL,
1740 `Description` text,
1741 `TimeStart` datetime NOT NULL,
1742 `Duration` float NOT NULL,
1743 `User` int(11) DEFAULT NULL,
1744 `Task` int(11) DEFAULT NULL,
1745 PRIMARY KEY (`Id`),
1746 KEY `User` (`User`),
1747 KEY `Task` (`Task`),
1748 KEY `TimeStart` (`TimeStart`)
1749) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
1750
1751--
1752-- RELACE PRO TABULKU `Work`:
1753-- `User`
1754-- `User` -> `Id`
1755-- `Task`
1756-- `Task` -> `Id`
1757--
1758
1759--
1760-- Omezení pro exportované tabulky
1761--
1762
1763--
1764-- Omezení pro tabulku `DocumentLineSequence`
1765--
1766ALTER TABLE `DocumentLineSequence`
1767 ADD CONSTRAINT `DocumentLineSequence_ibfk_1` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`),
1768 ADD CONSTRAINT `DocumentLineSequence_ibfk_2` FOREIGN KEY (`FinanceYear`) REFERENCES `FinanceYear` (`Id`);
1769
1770--
1771-- Omezení pro tabulku `File`
1772--
1773ALTER TABLE `File`
1774 ADD CONSTRAINT `File_ibfk_1` FOREIGN KEY (`Directory`) REFERENCES `FileDirectory` (`Id`);
1775
1776--
1777-- Omezení pro tabulku `FileDirectory`
1778--
1779ALTER TABLE `FileDirectory`
1780 ADD CONSTRAINT `FileDirectory_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `FileDirectory` (`Id`);
1781
1782--
1783-- Omezení pro tabulku `FinanceBankAccount`
1784--
1785ALTER TABLE `FinanceBankAccount`
1786 ADD CONSTRAINT `FinanceBankAccount_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
1787
1788--
1789-- Omezení pro tabulku `FinanceBillsItemsOld`
1790--
1791ALTER TABLE `FinanceBillsItemsOld`
1792 ADD CONSTRAINT `FinanceBillsItemsOld_ibfk_1` FOREIGN KEY (`Bill`) REFERENCES `FinanceBillsOld` (`Id`);
1793
1794--
1795-- Omezení pro tabulku `FinanceBillsOld`
1796--
1797ALTER TABLE `FinanceBillsOld`
1798 ADD CONSTRAINT `FinanceBillsOld_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
1799
1800--
1801-- Omezení pro tabulku `FinanceInvoice`
1802--
1803ALTER TABLE `FinanceInvoice`
1804 ADD CONSTRAINT `FinanceInvoice_ibfk_2` FOREIGN KEY (`File`) REFERENCES `File` (`Id`),
1805 ADD CONSTRAINT `FinanceInvoice_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
1806
1807--
1808-- Omezení pro tabulku `FinanceInvoiceItem`
1809--
1810ALTER TABLE `FinanceInvoiceItem`
1811 ADD CONSTRAINT `FinanceInvoiceItem_ibfk_1` FOREIGN KEY (`FinanceInvoice`) REFERENCES `FinanceInvoice` (`Id`);
1812
1813--
1814-- Omezení pro tabulku `FinanceOperation`
1815--
1816ALTER TABLE `FinanceOperation`
1817 ADD CONSTRAINT `FinanceOperation_ibfk_5` FOREIGN KEY (`File`) REFERENCES `File` (`Id`),
1818 ADD CONSTRAINT `FinanceOperation_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
1819 ADD CONSTRAINT `FinanceOperation_ibfk_3` FOREIGN KEY (`BankAccount`) REFERENCES `FinanceBankAccount` (`Id`),
1820 ADD CONSTRAINT `FinanceOperation_ibfk_4` FOREIGN KEY (`Treasury`) REFERENCES `FinanceTreasury` (`Id`);
1821
1822--
1823-- Omezení pro tabulku `Hyperlink`
1824--
1825ALTER TABLE `Hyperlink`
1826 ADD CONSTRAINT `Hyperlink_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `HyperlinkGroup` (`Id`);
1827
1828--
1829-- Omezení pro tabulku `ISMenuItem`
1830--
1831ALTER TABLE `ISMenuItem`
1832 ADD CONSTRAINT `ISMenuItem_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `ISMenuItem` (`Id`);
1833
1834--
1835-- Omezení pro tabulku `Log`
1836--
1837ALTER TABLE `Log`
1838 ADD CONSTRAINT `Log_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
1839
1840--
1841-- Omezení pro tabulku `Member`
1842--
1843ALTER TABLE `Member`
1844 ADD CONSTRAINT `Member_ibfk_23` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`),
1845 ADD CONSTRAINT `Member_ibfk_24` FOREIGN KEY (`ResponsibleUser`) REFERENCES `User` (`Id`),
1846 ADD CONSTRAINT `Member_ibfk_27` FOREIGN KEY (`BillingPeriod`) REFERENCES `FinanceBillingPeriod` (`Id`),
1847 ADD CONSTRAINT `Member_ibfk_28` FOREIGN KEY (`BillingPeriodNext`) REFERENCES `FinanceBillingPeriod` (`Id`);
1848
1849--
1850-- Omezení pro tabulku `MemberPayment`
1851--
1852ALTER TABLE `MemberPayment`
1853 ADD CONSTRAINT `MemberPayment_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);
1854
1855--
1856-- Omezení pro tabulku `MeteoStationMeasure`
1857--
1858ALTER TABLE `MeteoStationMeasure`
1859 ADD CONSTRAINT `MeteoStationMeasure_ibfk_1` FOREIGN KEY (`MeteoStation`) REFERENCES `MeteoStation` (`Id`);
1860
1861--
1862-- Omezení pro tabulku `NetworkAP`
1863--
1864ALTER TABLE `NetworkAP`
1865 ADD CONSTRAINT `NetworkAP_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);
1866
1867--
1868-- Omezení pro tabulku `NetworkDevice`
1869--
1870ALTER TABLE `NetworkDevice`
1871 ADD CONSTRAINT `NetworkDevice_ibfk_4` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`),
1872 ADD CONSTRAINT `NetworkDevice_ibfk_5` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`),
1873 ADD CONSTRAINT `NetworkDevice_ibfk_6` FOREIGN KEY (`Type`) REFERENCES `NetworkDeviceType` (`Id`),
1874 ADD CONSTRAINT `NetworkDevice_ibfk_7` FOREIGN KEY (`MapPosition`) REFERENCES `MapPosition` (`Id`);
1875
1876--
1877-- Omezení pro tabulku `NetworkDeviceConfig`
1878--
1879ALTER TABLE `NetworkDeviceConfig`
1880 ADD CONSTRAINT `NetworkDeviceConfig_ibfk_1` FOREIGN KEY (`Device`) REFERENCES `NetworkDevice` (`Id`);
1881
1882--
1883-- Omezení pro tabulku `NetworkFirewall`
1884--
1885ALTER TABLE `NetworkFirewall`
1886 ADD CONSTRAINT `NetworkFirewall_ibfk_1` FOREIGN KEY (`NetworkDevice`) REFERENCES `NetworkDevice` (`Id`);
1887
1888--
1889-- Omezení pro tabulku `NetworkInterface`
1890--
1891ALTER TABLE `NetworkInterface`
1892 ADD CONSTRAINT `NetworkInterface_ibfk_1` FOREIGN KEY (`Type`) REFERENCES `NetworkInterfaceType` (`Id`),
1893 ADD CONSTRAINT `NetworkInterface_ibfk_2` FOREIGN KEY (`Device`) REFERENCES `NetworkDevice` (`Id`);
1894
1895--
1896-- Omezení pro tabulku `NetworkLink`
1897--
1898ALTER TABLE `NetworkLink`
1899 ADD CONSTRAINT `NetworkLink_ibfk_2` FOREIGN KEY (`Interface2`) REFERENCES `NetworkInterface` (`Id`),
1900 ADD CONSTRAINT `NetworkLink_ibfk_1` FOREIGN KEY (`Interface1`) REFERENCES `NetworkInterface` (`Id`);
1901
1902--
1903-- Omezení pro tabulku `NetworkSegment`
1904--
1905ALTER TABLE `NetworkSegment`
1906 ADD CONSTRAINT `NetworkSegment_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `NetworkSegment` (`Id`);
1907
1908--
1909-- Omezení pro tabulku `NetworkSubnet`
1910--
1911ALTER TABLE `NetworkSubnet`
1912 ADD CONSTRAINT `NetworkSubnet_ibfk_1` FOREIGN KEY (`Member`) REFERENCES `Member` (`Id`);
1913
1914--
1915-- Omezení pro tabulku `News`
1916--
1917ALTER TABLE `News`
1918 ADD CONSTRAINT `News_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `NewsCategory` (`Id`),
1919 ADD CONSTRAINT `News_ibfk_2` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
1920
1921--
1922-- Omezení pro tabulku `Panel`
1923--
1924ALTER TABLE `Panel`
1925 ADD CONSTRAINT `Panel_ibfk_1` FOREIGN KEY (`PanelColumn`) REFERENCES `PanelColumn` (`Id`);
1926
1927--
1928-- Omezení pro tabulku `PermissionGroupAssignment`
1929--
1930ALTER TABLE `PermissionGroupAssignment`
1931 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `PermissionGroup` (`Id`),
1932 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`),
1933 ADD CONSTRAINT `PermissionGroupAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`);
1934
1935--
1936-- Omezení pro tabulku `PermissionUserAssignment`
1937--
1938ALTER TABLE `PermissionUserAssignment`
1939 ADD CONSTRAINT `PermissionUserAssignment_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
1940 ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`),
1941 ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`);
1942
1943--
1944-- Omezení pro tabulku `Product`
1945--
1946ALTER TABLE `Product`
1947 ADD CONSTRAINT `Product_ibfk_1` FOREIGN KEY (`Supplier`) REFERENCES `Subject` (`Id`),
1948 ADD CONSTRAINT `Product_ibfk_2` FOREIGN KEY (`Manufacturer`) REFERENCES `Subject` (`Id`),
1949 ADD CONSTRAINT `Product_ibfk_3` FOREIGN KEY (`UnitOfMeasure`) REFERENCES `UnitOfMeasure` (`Id`);
1950
1951--
1952-- Omezení pro tabulku `Service`
1953--
1954ALTER TABLE `Service`
1955 ADD CONSTRAINT `Service_ibfk_2` FOREIGN KEY (`ReplaceId`) REFERENCES `Service` (`Id`),
1956 ADD CONSTRAINT `Service_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `ServiceCategory` (`Id`);
1957
1958--
1959-- Omezení pro tabulku `ServiceCustomerRel`
1960--
1961ALTER TABLE `ServiceCustomerRel`
1962 ADD CONSTRAINT `ServiceCustomerRel_ibfk_3` FOREIGN KEY (`Service`) REFERENCES `Service` (`Id`),
1963 ADD CONSTRAINT `ServiceCustomerRel_ibfk_2` FOREIGN KEY (`Customer`) REFERENCES `Member` (`Id`);
1964
1965--
1966-- Omezení pro tabulku `Stock`
1967--
1968ALTER TABLE `Stock`
1969 ADD CONSTRAINT `Stock_ibfk_1` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`);
1970
1971--
1972-- Omezení pro tabulku `StockItem`
1973--
1974ALTER TABLE `StockItem`
1975 ADD CONSTRAINT `StockItem_ibfk_1` FOREIGN KEY (`Stock`) REFERENCES `Stock` (`Id`),
1976 ADD CONSTRAINT `StockItem_ibfk_3` FOREIGN KEY (`Location`) REFERENCES `Member` (`Id`),
1977 ADD CONSTRAINT `StockItem_ibfk_5` FOREIGN KEY (`Product`) REFERENCES `Product` (`Id`),
1978 ADD CONSTRAINT `StockItem_ibfk_6` FOREIGN KEY (`Segment`) REFERENCES `NetworkSegment` (`Id`);
1979
1980--
1981-- Omezení pro tabulku `Subject`
1982--
1983ALTER TABLE `Subject`
1984 ADD CONSTRAINT `Subject_ibfk_2` FOREIGN KEY (`MapPosition`) REFERENCES `MapPosition` (`Id`),
1985 ADD CONSTRAINT `Subject_ibfk_1` FOREIGN KEY (`AddressCountry`) REFERENCES `Country` (`Id`);
1986
1987--
1988-- Omezení pro tabulku `SubjectOpenTime`
1989--
1990ALTER TABLE `SubjectOpenTime`
1991 ADD CONSTRAINT `SubjectOpenTime_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
1992
1993--
1994-- Omezení pro tabulku `SubjectOpenTimeDay`
1995--
1996ALTER TABLE `SubjectOpenTimeDay`
1997 ADD CONSTRAINT `SubjectOpenTimeDay_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`);
1998
1999--
2000-- Omezení pro tabulku `Task`
2001--
2002ALTER TABLE `Task`
2003 ADD CONSTRAINT `Task_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `TaskGroup` (`Id`),
2004 ADD CONSTRAINT `Task_ibfk_2` FOREIGN KEY (`AssignedTo`) REFERENCES `User` (`Id`);
2005
2006--
2007-- Omezení pro tabulku `TaskGroup`
2008--
2009ALTER TABLE `TaskGroup`
2010 ADD CONSTRAINT `TaskGroup_ibfk_1` FOREIGN KEY (`Parent`) REFERENCES `TaskGroup` (`Id`);
2011
2012--
2013-- Omezení pro tabulku `TV`
2014--
2015ALTER TABLE `TV`
2016 ADD CONSTRAINT `TV_ibfk_1` FOREIGN KEY (`Language`) REFERENCES `Language` (`Id`),
2017 ADD CONSTRAINT `TV_ibfk_2` FOREIGN KEY (`Category`) REFERENCES `TVGroup` (`Id`);
2018
2019--
2020-- Omezení pro tabulku `UserCustomerRel`
2021--
2022ALTER TABLE `UserCustomerRel`
2023 ADD CONSTRAINT `usercustomerrel_ibfk_1` FOREIGN KEY (`Customer`) REFERENCES `Member` (`Id`),
2024 ADD CONSTRAINT `usercustomerrel_ibfk_2` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);
2025
2026--
2027-- Omezení pro tabulku `Work`
2028--
2029ALTER TABLE `Work`
2030 ADD CONSTRAINT `Work_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`),
2031 ADD CONSTRAINT `Work_ibfk_2` FOREIGN KEY (`Task`) REFERENCES `Task` (`Id`);
2032 ");
2033 $Manager->Execute("INSERT INTO `SystemVersion` (`Id`, `Revision`) VALUES
2034(1, 495);");
2035
2036}
2037
2038function InsertSampleData($Manager)
2039{
2040 $Manager->Execute("INSERT INTO `Country` (`Id`, `Name`) VALUES
2041(1, 'Česká Republika'),
2042(2, 'Slovenská Republika'),
2043(3, 'Litva'),
2044(4, 'Rakousko'),
2045(5, 'Německo'),
2046(6, 'Polsko'),
2047(7, 'Francie'),
2048(8, 'Itálie');");
2049 $Manager->Execute("INSERT INTO `User` (`Id`, `Login`, `Name`, `Password`, `Salt`, `Email`, `LastIpAddress`, `LastLoginTime`, `RegistrationTime`, `Locked`, `ICQ`, `PhoneNumber`, `InitPassword`) VALUES
2050(1, 'admin', 'Správce', '05d97409afcce47d028c0d2a04cf359998cbaaf1', 'b295d117135a9763da282e7dae73a5ca7d3e5b11', 'admin@localhost', '', '0000-00-00 00:00:00', '2013-03-01 19:40:22', 0, 0, '+420123456789', '');");
2051 $Manager->Execute("INSERT INTO `MapPosition` (`Id`, `Name`, `Latitude`, `Longitude`) VALUES
2052(1, 'Franta Vopršálek', 47.555, 11.082)");
2053 $Manager->Execute("INSERT INTO `Subject` (`Id`, `Name`, `AddressStreet`, `AddressTown`, `AddressPSC`, `AddressCountry`, `IC`, `DIC`, `PayVAT`, `MapPosition`, `WWW`, `Note`) VALUES
2054(1, 'Franta Vopršálek', 'Na hradě 1001', 'Bouzov', 12345, 1, '12345667', 'CZ1234567890', 0, 1, '', '');");
2055 $Manager->Execute("INSERT INTO `UnitOfMeasure` (`Id`, `Unit`, `Name`) VALUES
2056(1, 'ks', 'kus'),
2057(2, 'l', 'litr'),
2058(3, 'g', 'gram'),
2059(4, 'Kg', 'Kilogram'),
2060(5, 'm', 'metr'),
2061(6, 'km', 'kilometr'),
2062(7, 'mm', 'milimetr'),
2063(8, 'cm', 'centimetr'),
2064(9, 'Mbit/s', 'megabity za sekundu'),
2065(10, 'bit/s', 'bity za sekundu');");
2066 $Manager->Execute("INSERT INTO `TVGroup` (`Id`, `Name`) VALUES
2067(1, 'Sportovní'),
2068(2, 'Zábavný'),
2069(3, 'Hudební'),
2070(4, 'Zpravodajský'),
2071(5, 'Regionální'),
2072(6, 'Filmový');");
2073 $Manager->Execute("INSERT INTO `HyperlinkGroup` (`Id`, `Name`) VALUES
2074(1, 'Síť'),
2075(2, 'Místní organizace'),
2076(3, 'Stránky občanů'),
2077(4, 'Vyhledávání'),
2078(5, 'Užitečné'),
2079(6, 'Zábava'),
2080(7, 'Hostované stránky'),
2081(8, 'Prodej počítačů'),
2082(9, 'Různé');");
2083 $Manager->Execute("INSERT INTO `Language` (`Id`, `Name`) VALUES
2084(1, 'Česky'),
2085(2, 'Slovensky'),
2086(3, 'Anglicky'),
2087(4, 'Německy'),
2088(6, 'Polsky');");
2089 $Manager->Execute("INSERT INTO `Hyperlink` (`Id`, `Name`, `URL`, `Group`, `IconFile`, `PermissionModule`, `PermissionOperation`, `Enable`) VALUES
2090(1, 'Finance', '/finance/', 1, 'money.png', '', '', 1),
2091(2, 'Statistika', 'http://stat.zdechov.net/centrala/', 1, 'chart.png', '', '', 1),
2092(3, 'Seznam uživatelů', '/userlist.php', 1, 'comp.png', '', '', 1),
2093(4, 'Seznam počítačů', '/hostlist.php', 1, 'comp.png', '', '', 1),
2094(5, 'Sdílení souborů', 'http://wiki.zdechov.net/index.php/DC_hub', 1, 'prohledavac_sdileni.png', '', '', 0),
2095(6, 'Historie chatu', '/chat/history.php', 9, 'sunrisechat.png', 'Chat', 'Display', 0),
2096(7, 'Webový chat', 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&amp;channel=%23zdechov&amp;forcePrompt=true&amp;charset=utf-8', 9, 'sunrisechat.png', '', '', 1),
2097(8, 'Fotogalerie', '/galerie/', 9, 'gallery.png', '', '', 1),
2098(9, 'Diskusní fórum', 'http://forum.zdechov.net/', 9, 'discus.png', '', '', 1),
2099(10, 'WebMail', 'https://mail.zdechov.net/', 9, 'openwebmail.png', '', '', 1),
2100(11, 'Jídelníček', '/jidelna/', 9, 'apple.png', '', '', 1),
2101(12, 'Mapa sítě', '/map/', 1, 'map.png', '', '', 1),
2102(13, 'Otvírací doby', '/otevreno.php', 9, 'otv_doby.png', '', '', 1),
2103(14, 'Wiki', 'http://wiki.zdechov.net/', 9, 'clear.png', '', '', 1),
2104(15, 'Topologie sítě', '/is/topologie.php', 1, 'topologie.png', '', '', 1),
2105(16, 'Technické informace', '/network.php', 1, 'tech.png', '', '', 1),
2106(17, 'Webkamery', 'http://www.zdechov.net/kamery/', 9, 'camera.png', '', '', 1),
2107(18, 'ZděchovNET', 'http://www.zdechov.net/', 1, '', '', '', 1),
2108(21, 'Obecní úřad', 'http://www.zdechov.cz/', 2, 'obec_zdechov.png', '', '', 1),
2109(22, 'Motokrosová grapa', 'http://zdechovskagrapa.sweb.cz/', 2, '', '', '', 1),
2110(23, 'Skiareál', 'http://skiareal.zdechov.net/', 2, 'www_snbzdechov_com.png', '', '', 1),
2111(24, 'Sbor dobrovolných hasičů', 'http://sdh.zdechov.net/', 2, '', '', '', 1),
2112(25, 'TJ Sokol', 'http://fotbal.zdechov.net/', 2, 'socer.png', '', '', 1),
2113(26, 'Farnost', 'http://farnost.zdechov.net/', 2, 'cfix.png', '', '', 1),
2114(27, 'Staněk Tatra team', 'http://www.stanek-tatra.cz/', 3, 'www_stanek-tatra_cz.png', '', '', 1),
2115(28, 'Zděchov.eu', 'http://www.zdechov.eu/', 3, 'obec_zdechov.png', '', '', 1),
2116(29, 'Google', 'http://www.google.cz/', 4, 'www_google_cz.png', '', '', 1),
2117(30, 'Morfeo', 'http://morfeo.centrum.cz/', 4, 'morfeo.png', '', '', 0),
2118(31, 'Centrum', 'http://www.centrum.cz/', 4, 'www_centrum_cz.png', '', '', 1),
2119(32, 'Seznam', 'http://www.seznam.cz/', 4, 'www_seznam_cz.png', '', '', 1),
2120(33, 'Atlas', 'http://www.atlas.cz/', 4, 'www_atlas_cz.png', '', '', 1),
2121(34, 'Tiscali', 'http://www.tiscali.cz/', 4, 'www_tiscali_cz.png', '', '', 1),
2122(35, 'Mapa ČR', 'http://www.mapy.cz/', 5, 'www_mapy_cz.png', '', '', 1),
2123(36, 'Online TV', 'http://www.tvinfo.cz/live/televize/evropa/cz', 5, 'www_tvinfo_cz.png', '', '', 1),
2124(37, 'Jízdní řády', 'http://jizdnirady.idnes.cz/', 5, 'www_idos_cz.png', '', '', 1),
2125(38, 'TV programy', 'http://tv.atlas.cz/', 5, 'www_atlas_cz.png', '', '', 1),
2126(39, 'ICQ', 'http://www.icq.com/download/icq2go/', 5, 'www_icq_com.png', '', '', 1),
2127(40, 'Slovníky', 'http://www.slovnik.cz/', 5, 'www_slovnik_cz.png', '', '', 1),
2128(41, 'Počasí', 'http://www.meteopress.cz/', 5, 'pocasi.png', '', '', 1),
2129(42, 'T-Mobile SMS', 'http://www.tzones.cz/', 5, 'www_tzones_cz.png', '', '', 1),
2130(43, 'Knihovna&nbsp;Vsetín', 'http://www.mvk.cz/', 5, 'www_mvk_cz.png', '', '', 1),
2131(44, 'Youtube', 'http://www.youtube.com/', 6, 'www_youtube_com.png', '', '', 1),
2132(45, 'Stream.cz', 'http://www.stream.cz/', 6, 'www_stream_cz.png', '', '', 1),
2133(46, 'Last.fm', 'http://www.last.fm/', 6, 'www_last_fm.png', '', '', 1),
2134(47, 'Ulož.to', 'http://uloz.to/', 6, 'uloz_to.png', '', '', 1),
2135(48, 'SOFTCOM', 'http://www.softcom.cz', 8, 'www_computershop_cz.png', '', '', 1),
2136(49, 'Alfacomp', 'http://www.alfacomp.cz/php/zbozi.php?akc=2', 8, 'www_alfacomp_cz.png', '', '', 1),
2137(50, 'Petracomp', 'http://www.petracomp.cz/', 8, 'www_petracomp_cz.png', '', '', 0),
2138(51, 'TS Bohemia', 'http://interlink.tsbohemia.cz/', 8, 'www_tsbohemia_cz.png', '', '', 1),
2139(58, 'Volný', 'http://web.volny.cz/', 4, 'volny.png', '', '', 1),
2140(61, 'Test rychlost', 'http://rychlost.cz/', 5, 'rychlost_cz.png', '', '', 1),
2141(62, 'Zděchov na Facebooku', 'http://www.facebook.com/group.php?gid=180682342445', 3, 'facebook.png', '', '', 1),
2142(63, 'Pizzerie Zádilský', 'http://pizzerie.huslenky.cz/', 5, '', '', '', 1),
2143(64, 'Televize', '/tv/', 1, 'tv.png', '', '', 1),
2144(65, 'Telefonní seznam', 'http://wiki.zdechov.net/wiki/Telefonní_seznam', 9, 'tel.png', '', '', 1),
2145(66, 'JT Servis', 'http://jtservis.cz/', 3, '', '', '', 1),
2146(67, 'Speedtest mini', '/speedtestnet/', 1, 'speedtestnet.png', '', '', 1),
2147(68, 'Zděchovská 30', 'http://tricitka.zdechov.net', 2, '', '', '', 1),
2148(69, 'ZŠ a MŠ Zděchov', 'http://zsams.zdechov.net', 2, '', '', '', 1);");
2149 $Manager->Execute("INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2150(1, 'DNS server (named)', '/usr/bin/php dns.php|/etc/init.d/named reload', 0, '2013-02-04 00:36:38', 0, 1, 60, ''),
2151(2, 'Firewall rules (iptables)', '/usr/bin/php iptables.php', 0, '2008-12-06 17:36:26', 0, 0, 60, ''),
2152(3, 'Traffic Shaping (tc, iptables)', '/usr/bin/php traffic_shaping.php|/a/bin/htb.sh', 0, '2009-03-02 20:41:41', 0, 0, 60, ''),
2153(4, 'DHCP server (dhcpd)', '/usr/bin/php dhcp.php|/etc/init.d/dhcpd restart 1>/dev/null 2>/dev/null', 0, '2009-03-09 16:42:43', 0, 0, 60, ''),
2154(5, 'VPN server (pptpd)', '/usr/bin/php vpn.php|/a/bin/vpn.sh', 0, '2008-04-26 08:33:50', 0, 0, 60, '');
2155INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2156(7, 'DHCP server (/ip dhcp-server lease)', '/usr/bin/php dhcp.php', 0, '2013-01-01 16:00:44', 48, 1, 60, '');
2157INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2158(8, 'Netwatch (/tool netwatch)', '/usr/bin/php netwatch.php', 0, '2012-12-01 15:18:53', 39, 1, 60, '');
2159INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2160(9, 'Queue (/queue tree)', '/usr/bin/php queue.php', 0, '2013-02-04 00:07:06', 4, 1, 60, '');
2161INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2162(10, 'Network translation (/ip firewall nat)', '/usr/bin/php firewall_nat.php', 0, '2013-01-27 17:25:33', 3, 1, 60, '');
2163INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2164(11, 'Traffic marking (/ip firewall mangle)', '/usr/bin/php firewall_mangle.php', 0, '2013-02-04 00:05:31', 4, 1, 60, '');
2165INSERT INTO `NetworkConfiguration` (`Id`, `Caption`, `Execute`, `Changed`, `LastTime`, `ExecutionTime`, `Enabled`, `Period`, `Log`) VALUES
2166(12, 'Firewall filter (/ip firewall filter)', '/usr/bin/php firewall_filter.php', 0, '2011-01-15 09:32:57', 0, 1, 60, ''),
2167(13, 'DNS server (routerboard)', '/usr/bin/php dns_routerboard.php', 0, '0000-00-00 00:00:00', 0, 1, 60, '');");
2168 $Manager->Execute("INSERT INTO `NetworkDeviceType` (`Id`, `Name`, `ShowOnline`, `IconName`) VALUES
2169(1, 'Server', 0, 'device'),
2170(2, 'Stolní počítač', 1, 'comp'),
2171(3, 'Přenosný počítač', 1, 'comp'),
2172(4, 'Směrovač', 0, 'device'),
2173(5, 'Rozbočovač', 0, 'device'),
2174(6, 'Tiskárna', 0, 'device'),
2175(7, 'Telefón', 0, 'device'),
2176(8, 'PDA/MDA', 1, 'comp'),
2177(9, 'Kamera', 0, 'device'),
2178(10, 'Meteostanice', 1, 'device');");
2179 $Manager->Execute("INSERT INTO `NetworkInterfaceType` (`Id`, `Name`, `MaxSpeed`, `FullDuplex`, `Color`) VALUES
2180(1, 'Fast Ethernet', 100, 1, 'ffffff'),
2181(2, 'Gigabit Ethernet', 1000, 1, 'ffffff'),
2182(3, 'Ethernet', 10, 1, 'ffffff'),
2183(4, 'Wi-Fi 802.11b', 11, 0, 'ffffff'),
2184(5, 'Wi-Fi 802.11b/g', 54, 0, 'ffffff'),
2185(6, 'Wi-Fi 802.11a/b/g', 54, 0, 'ffffff'),
2186(7, 'Wi-Fi 802.11n', 300, 0, 'ffffff');");
2187 $Manager->Execute("INSERT INTO `NetworkSubnet` (`Id`, `Name`, `AddressRange`, `Mask`, `DHCP`, `Gateway`, `WINS`, `DNS`, `Domain`, `NTP`, `Member`, `ExtAddressRange`, `ExtMask`, `AddressRangeIPv6`, `Configure`) VALUES
2188(1, 'Hlavní', '172.16.0.0', 24, '172.16.0.1', '172.16.0.1', '172.16.1.2', '172.16.0.2,172.16.0.3', 'company.net', '172.16.0.2,172.16.0.3', NULL, '', 32, '2001:470:1234:1::/64', 1),
2189(2, 'Servery', '172.16.1.0', 24, '172.16.1.1', '172.16.1.1', '172.16.1.2', '172.16.0.2,172.16.0.3', 'company.net', '172.16.0.2,172.16.0.3', NULL, '', 32, '2001:470:1234:2::/64', 1);");
2190 $Manager->Execute("INSERT INTO `PanelColumn` (`Id`, `Width`) VALUES
2191(1, ''),
2192(2, ''),
2193(3, '70%');");
2194 $Manager->Execute("INSERT INTO `Panel` (`Id`, `Module`, `Parameters`, `Order`, `PanelColumn`) VALUES
2195(1, 'HyperlinkGroup', '1', 2, 1),
2196(3, 'HyperlinkGroup', '4', 1, 2),
2197(4, 'HyperlinkGroup', '5', 2, 2),
2198(5, 'HyperlinkGroup', '6', 3, 2),
2199(6, 'HyperlinkGroup', '2', 4, 2),
2200(7, 'HyperlinkGroup', '3', 5, 2),
2201(8, 'NewsGroupList', '', 2, 3),
2202(9, 'Webcam', '', 3, 1),
2203(11, 'UserOptions', '', 1, 3),
2204(13, 'HyperlinkGroup', '9', 1, 1);");
2205 $Manager->Execute("INSERT INTO `NewsCategory` (`Id`, `Caption`, `Permission`, `Sequence`, `Group`, `RSS`) VALUES
2206(1, 'Různé informace', 1, 3, 2, ''),
2207(2, 'Bazar', 1, 6, 2, ''),
2208(3, 'Dění v obci', 1, 2, 2, ''),
2209(4, 'Diskusní fórum', 0, 10, 1, ''),
2210(5, 'Správa sítě - oznámení', 0, 1, 1, ''),
2211(6, 'Správa sítě - výpadky', 0, 13, 1, ''),
2212(8, 'Fotbal', 1, 4, 2, ''),
2213(9, 'Správa sítě - změny zařízení', 0, 12, 1, ''),
2214(10, 'Multimediální archív', 0, 11, 1, ''),
2215(11, 'Obecní úřad - úřední deska', 0, 7, 2, ''),
2216(12, 'Obecní úřad - aktuality', 0, 8, 2, ''),
2217(13, 'TV Beskyd', 0, 9, 1, ''),
2218(14, 'Hokej', 1, 5, 2, ''),
2219(15, 'Kino Vatra', 0, 15, 1, 'http://www.dkvsetin.cz/rss/kino/8'),
2220(16, 'Obec Hovězí', 0, 16, 1, 'http://www.obec-hovezi.cz/web/rss.xml');");
2221 $Manager->Execute("INSERT INTO `FinanceBillingPeriod` (`Id`, `Name`, `MonthCount`) VALUES
2222(1, 'Nikdy', 0),
2223(2, 'Měsíčně', 1),
2224(3, 'Čtvrtletně', 3),
2225(4, 'Pololetně', 6),
2226(5, 'Ročně', 12);");
2227 $Manager->Execute("INSERT INTO `Member` (`Id`, `Name`, `Subject`, `ResponsibleUser`, `FamilyMemberCount`, `MembershipDate`, `MemberState`, `GPS`, `BillingPeriod`, `NetworkSegment`, `BillingPeriodNext`, `BillingPeriodLastDate`, `Hire`, `Blocked`, `PayDay`) VALUES
2228(1, 'Franta Vopršálek', 1, 1, 5, '2004-07-31', 0, 0, 1, 5, 1, '2009-03-31', 0, 0, 1);");
2229 $Manager->Execute("INSERT INTO `PermissionGroup` (`Id`, `Description`) VALUES
2230(1, 'Ostatní'),
2231(2, 'Registrovaní uživatelé'),
2232(3, 'Zástupci za domácnost'),
2233(4, 'Správci sítě'),
2234(5, 'Systémoví administrátoři');");
2235 $Manager->Execute("INSERT INTO `PermissionOperation` (`Id`, `Module`, `Operation`, `Item`, `ItemId`) VALUES
2236(1, 'News', 'Display', 'Item', 0),
2237(2, 'News', 'Insert', '', 0),
2238(3, 'News', 'Display', 'Item', 0),
2239(4, 'News', 'Insert', 'Group', 5),
2240(5, 'News', 'Display', 'Group', 5),
2241(6, 'News', 'Insert', 'Group', 1),
2242(7, 'News', 'Display', 'Group', 1),
2243(8, 'News', 'Insert', 'Group', 2),
2244(9, 'News', 'Display', 'Group', 2),
2245(10, 'News', 'Insert', 'Group', 3),
2246(11, 'News', 'Display', 'Group', 3),
2247(12, 'News', 'Insert', 'Group', 4),
2248(13, 'News', 'Display', 'Group', 4),
2249(14, 'News', 'Insert', 'Group', 6),
2250(15, 'News', 'Display', 'Group', 6),
2251(16, 'News', 'Insert', 'Group', 8),
2252(17, 'News', 'Display', 'Group', 8),
2253(18, 'News', 'Insert', 'Group', 9),
2254(19, 'News', 'Display', 'Group', 9),
2255(20, 'News', 'Insert', 'Group', 10),
2256(21, 'News', 'Display', 'Group', 10),
2257(22, 'News', 'Insert', 'Group', 11),
2258(23, 'News', 'Display', 'Group', 11),
2259(24, 'News', 'Insert', 'Group', 12),
2260(25, 'News', 'Display', 'Group', 12),
2261(26, 'Chat', 'Display', '', 0),
2262(27, 'Share', 'Display', '', 0),
2263(28, 'Finance', 'DisplaySubjectState', '', 0),
2264(29, 'EatingPlace', 'Edit', '', 0),
2265(30, 'Finance', 'Manage', '', 0),
2266(31, 'Network', 'Edit', '', 0),
2267(32, 'Finance', 'SubjectList', '', 0),
2268(33, 'Network', 'Administration', '', 0),
2269(34, 'Log', 'Show', '', 0),
2270(35, 'Network', 'RegistredHostList', '', 0),
2271(36, 'Finance', 'TradingStatus', '', 0),
2272(37, 'Finance', 'MemberOptions', '', 0),
2273(38, 'SubjectOpenTime', 'Edit', '', 0),
2274(39, 'News', 'Display', 'Group', 13),
2275(40, 'News', 'Insert', 'Group', 14),
2276(41, 'News', 'Display', 'Group', 14),
2277(42, 'News', 'Display', 'Group', 15),
2278(43, 'News', 'Display', 'Group', 16),
2279(44, 'IS', 'Manage', '', 0);");
2280 $Manager->Execute("INSERT INTO `PermissionGroupAssignment` (`Id`, `Group`, `AssignedGroup`, `AssignedOperation`) VALUES
2281(1, 2, 1, NULL),
2282(2, 3, 2, NULL),
2283(3, 4, 3, NULL),
2284(4, 5, 4, NULL),
2285(5, 1, NULL, 1),
2286(6, 2, NULL, 2),
2287(7, 1, NULL, 3),
2288(8, 1, NULL, 5),
2289(9, 4, NULL, 4),
2290(10, 1, NULL, 7),
2291(11, 2, NULL, 6),
2292(12, 1, NULL, 9),
2293(13, 2, NULL, 8),
2294(14, 1, NULL, 11),
2295(15, 2, NULL, 10),
2296(16, 1, NULL, 13),
2297(17, 4, NULL, 12),
2298(18, 1, NULL, 15),
2299(19, 4, NULL, 14),
2300(20, 1, NULL, 17),
2301(21, 2, NULL, 16),
2302(22, 1, NULL, 19),
2303(23, 4, NULL, 18),
2304(24, 1, NULL, 21),
2305(25, 4, NULL, 20),
2306(26, 1, NULL, 23),
2307(27, 4, NULL, 22),
2308(28, 1, NULL, 25),
2309(29, 4, NULL, 24),
2310(30, 1, NULL, 26),
2311(31, 2, NULL, 27),
2312(32, 3, NULL, 28),
2313(33, 4, NULL, 30),
2314(34, 4, NULL, 31),
2315(35, 4, NULL, 32),
2316(36, 4, NULL, 33),
2317(37, 4, NULL, 34),
2318(38, 3, NULL, 35),
2319(39, 5, NULL, 36),
2320(40, 3, NULL, 37),
2321(41, 4, NULL, 38),
2322(42, 1, NULL, 39),
2323(43, 2, NULL, 40),
2324(44, 1, NULL, 41),
2325(45, 1, NULL, 42),
2326(46, 1, NULL, 43),
2327(47, 4, NULL, 44);");
2328 $Manager->Execute("INSERT INTO `PermissionUserAssignment` (`Id`, `User`, `AssignedGroup`, `AssignedOperation`) VALUES
2329(1, 1, 5, NULL);");
2330 $Manager->Execute("INSERT INTO `UserCustomerRel` (`Id`, `Customer`, `User`) VALUES
2331(1, 1, 1);");
2332 $Manager->Execute("INSERT INTO `ISMenuItem` (`Id`, `Name`, `Parent`, `Table`, `IconName`) VALUES
2333(1, 'Síť', NULL, '', ''),
2334(2, 'Finance', NULL, '', ''),
2335(3, 'Zařízení', 1, 'NetworkDevice', ''),
2336(4, 'Rozhraní', 1, 'NetworkInterface', ''),
2337(5, 'Příjmy a výdaje', 2, 'FinanceOperation', ''),
2338(6, 'Závazky a pohledávky', 2, 'FinanceClaimsLiabilities', ''),
2339(7, 'Typ zařízení', 1, 'NetworkDeviceType', ''),
2340(8, 'Typ rozhraní', 1, 'NetworkInterfaceType', ''),
2341(9, 'Doménové aliasy', 1, 'NetworkDomainAlias', ''),
2342(10, 'Bankovní účty', 2, 'FinanceBankAccount', ''),
2343(11, 'Pokladny', 2, 'FinanceTreasury', ''),
2344(12, 'Obecné', NULL, '', ''),
2345(13, 'Uživatelé', 12, 'User', ''),
2346(14, 'Subjekty', 12, 'Subject', ''),
2347(15, 'Země', 12, 'Country', ''),
2348(18, 'Platební období', 2, 'FinanceBillingPeriod', ''),
2349(19, 'Služby', 2, 'Service', ''),
2350(20, 'Zákazníci', 2, 'Member', ''),
2351(22, 'Podsítě', 1, 'NetworkSubnet', ''),
2352(23, 'Systém', NULL, '', ''),
2353(24, 'Záznamy', 23, 'Log', ''),
2354(25, 'Úkoly', 12, 'Task', ''),
2355(26, 'Kategorie úkolů', 12, 'TaskGroup', ''),
2356(27, 'Sklad', NULL, '', ''),
2357(30, 'TV kanály', 12, 'TV', ''),
2358(31, 'Jazyky', 12, 'Language', ''),
2359(32, 'Kategorie TV kanálů', 12, 'TVGroup', ''),
2360(33, 'Účetní roky', 2, 'FinanceYear', ''),
2361(34, 'Dokladové řady', 2, 'DocumentLine', ''),
2362(35, 'Čísleník dokladové řady', 2, 'DocumentLineSequence', ''),
2363(36, 'Nastavení zařízení', 1, 'NetworkDeviceConfig', ''),
2364(37, 'Práce', 12, 'Work', ''),
2365(38, 'Skladové položky', 27, 'StockItem', ''),
2366(39, 'Měrné jednotky', 27, 'UnitOfMeasure', ''),
2367(40, 'Produkty', 27, 'Product', ''),
2368(41, 'Sklady', 27, 'Stock', '');");
2369 $Manager->Execute("INSERT INTO `ServiceCategory` (`Id`, `Name`) VALUES
2370(1, 'Internet'),
2371(2, 'VoIP'),
2372(3, 'Spotřeba + nájem'),
2373(4, 'IPTV'),
2374(5, 'IP kamery'),
2375(6, 'Meteostanice'),
2376(7, 'Web hosting'),
2377(8, 'VPS hosting');");
2378 $Manager->Execute("INSERT INTO `Service` (`Id`, `Name`, `Category`, `Price`, `CustomerCount`, `ReplaceId`, `Public`, `InternetSpeedMin`, `InternetSpeedMax`, `UploadAsymmetry`, `Memory`, `MemorySwap`, `Storage`, `CPUCount`) VALUES
2379(1, 'Internet 4M', 1, 190, 23, NULL, 1, 4096, 204, 1, 0, 0, 0, 0),
2380(2, 'Internet 8M', 1, 260, 23, NULL, 1, 8192, 408, 1, 0, 0, 0, 0),
2381(3, 'Internet 16M', 1, 360, 50, NULL, 1, 16384, 816, 1, 0, 0, 0, 0),
2382(4, 'Internet 32M', 1, 520, 6, NULL, 1, 32768, 1638, 1, 0, 0, 0, 0),
2383(5, 'Internet 64M', 1, 750, 0, NULL, 1, 65536, 8196, 1, 0, 0, 0, 0),
2384(6, 'Internet Instituce', 2, 1000, 1, NULL, 1, 65536, 8192, 1, 0, 0, 0, 0),
2385(7, 'Zdarma', 3, 0, 12, NULL, 1, 128, 128, 1, 0, 0, 0, 0),
2386(8, 'Hosting 4GB', 2, 500, 2, NULL, 1, 64000, 4000, 1, 0, 0, 0, 0),
2387(9, 'Hosting 2GB', 2, 300, 0, NULL, 1, 40000, 2000, 1, 0, 0, 0, 0),
2388(10, 'Hosting 1GB', 2, 170, 1, NULL, 1, 30000, 2000, 1, 0, 0, 0, 0),
2389(11, 'Hosting 512M', 2, 100, 0, NULL, 1, 20000, 1500, 1, 0, 0, 0, 0),
2390(12, 'Hosting 8GB', 2, 900, 1, NULL, 1, 60000, 4000, 1, 0, 0, 0, 0),
2391(13, 'Hosting 16G', 2, 1500, 0, NULL, 1, 60000, 4000, 1, 0, 0, 0, 0),
2392(14, 'Hosting 6GB', 2, 700, 0, NULL, 1, 64000, 4000, 1, 0, 0, 0, 0);");
2393 $Manager->Execute("INSERT INTO `ServiceCustomerRel` (`Id`, `Service`, `Customer`, `Period`) VALUES
2394(1, 1, 1, 0), (2, 1, 1, 1);");
2395 $Manager->Execute("INSERT INTO `File` (`Id` ,`Name` ,`Size` ,`Directory`) ".
2396 "VALUES (1 , 'invoice_1.pdf', '123', NULL);");
2397 $Manager->Execute("INSERT INTO `FinanceInvoice` (`Id` ,`BillCode` ,`Subject` ,`TimeCreation` ,`TimeDue` ,`TimePayment` ,`Value` ,`File` ,`Text` ,`PeriodTo` ,`PeriodFrom`) ".
2398 "VALUES (1 , 'VF123/2013', '1', NOW( ) , '0000-00-00 00:00:00', NULL , '300', '1', 'Měsíční paušál', '2013-01-01', '2013-01-31');");
2399 $Manager->Execute("INSERT INTO `FinanceInvoiceItem` (`Id` ,`FinanceInvoice` ,`Description` ,`Price` ,`VAT` ,`Quantity`) ".
2400 "VALUES (1 , '1', 'Internet 16M', '300', '21', '1');");
2401 $Manager->Execute("INSERT INTO `FinanceYear` (`Id`, `Year`, `DateStart`, `DateEnd`) VALUES
2402(1, 2007, '2007-12-01', '2007-12-31'),
2403(2, 2008, '2008-01-01', '2008-12-31'),
2404(3, 2009, '2009-01-01', '2009-12-31'),
2405(4, 2010, '2010-01-01', '2010-12-31'),
2406(6, 2011, '2011-01-01', '2011-12-31'),
2407(7, 2012, '2012-01-01', '2012-12-31'),
2408(8, 2013, '2013-01-01', '2013-12-31');");
2409 $Manager->Execute("INSERT INTO `FinanceCharge` (`Period`, `Internet`, `InternetSpeed`, `InternetSpeedReserve`, `AdministrationPerUser`, `kWh`, `BaseSpeedElement`, `BaseTariffPrice`, `TopTariffPrice`) VALUES
2410(1, 10000, 100000, 10000, 50, 6, 1024, 50, 138),
2411(0, 10000, 100000, 10000, 50, 6, 1024, 50, 138);");
2412 $Manager->Execute("INSERT INTO `DocumentLine` (`Id`, `Name`, `Shortcut`) VALUES
2413(1, 'Příjmy do pokladny', 'PP'),
2414(2, 'Výdeje z pokladny', 'VP'),
2415(3, 'Příjem na účet', 'BV'),
2416(4, 'Výdej z účtu', 'PR'),
2417(5, 'Přijaté faktury', 'PF'),
2418(6, 'Vydané faktury', 'VF'),
2419(7, 'Výdej ze skladu', 'VS'),
2420(8, 'Příjem na sklad', 'PS');");
2421}
Note: See TracBrowser for help on using the repository browser.