source: branches/test1/Client/SQL/Structure.sql

Last change on this file was 6, checked in by george, 14 years ago
  • Activated generation of language files.
  • Added: Full screen mode.
File size: 8.7 KB
Line 
1-- phpMyAdmin SQL Dump
2-- version 3.2.5
3-- http://www.phpmyadmin.net
4--
5-- Počítač: localhost
6-- Vygenerováno: Čtvrtek 03. června 2010, 18:00
7-- Verze MySQL: 5.1.46
8-- Verze PHP: 5.3.2
9
10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
12--
13-- Databáze: `chronis_system`
14--
15
16-- --------------------------------------------------------
17
18--
19-- Struktura tabulky `Object`
20--
21
22CREATE TABLE IF NOT EXISTS `Object` (
23 `Id` int(11) NOT NULL AUTO_INCREMENT,
24 `Name` varchar(255) NOT NULL,
25 `Schema` varchar(255) NOT NULL,
26 `Table` varchar(255) NOT NULL,
27 `PrimaryKey` varchar(255) NOT NULL DEFAULT 'Id',
28 `Sequence` int(11) NOT NULL,
29 `Group` int(11) NOT NULL,
30 PRIMARY KEY (`Id`),
31 KEY `Group` (`Group`)
32) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
33
34--
35-- Vypisuji data pro tabulku `Object`
36--
37
38INSERT INTO `Object` (`Id`, `Name`, `Schema`, `Table`, `PrimaryKey`, `Sequence`, `Group`) VALUES
39(1, 'Síťová zařízení', 'centrala', 'NetworkDevice', 'Id', 0, 1),
40(2, 'Rozhraní zařízení', 'centrala', 'NetworkInterface', 'Id', 0, 1),
41(3, 'Faktury', 'centrala', 'Invoice', 'Id', 0, 2),
42(4, 'Bankovní účty', 'centrala', 'BankAccount', 'Id', 0, 2),
43(5, 'Subjekty', 'centrala', 'Subject', 'Id', 0, 4),
44(6, 'Uživatelé', 'centrala', 'User', 'Id', 0, 4),
45(7, 'Členové', 'centrala', 'Member', 'Id', 0, 4),
46(8, 'Skupiny objektů', 'chronis_system', 'ObjectGroup', 'Id', 0, 5),
47(9, 'Objekty', 'chronis_system', 'Object', 'Id', 0, 5),
48(10, 'Typy vlastností', 'chronis_system', 'Type', 'Id', 0, 5),
49(11, 'Skupiny vlastností', 'chronis_system', 'PropertyGroup', 'Id', 0, 5),
50(12, 'Vlastnosti', 'chronis_system', 'Property', 'Id', 0, 5),
51(13, 'Typ zařízení', 'centrala', 'NetworkDeviceType', 'Id', 0, 1),
52(14, 'Typ rozhraní', 'centrala', 'NetworkInterfaceType', 'Id', 0, 1);
53
54-- --------------------------------------------------------
55
56--
57-- Struktura tabulky `ObjectGroup`
58--
59
60CREATE TABLE IF NOT EXISTS `ObjectGroup` (
61 `Id` int(11) NOT NULL AUTO_INCREMENT,
62 `Name` varchar(255) NOT NULL,
63 `Parent` int(11) NOT NULL,
64 `Sequence` int(11) NOT NULL,
65 PRIMARY KEY (`Id`)
66) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
67
68--
69-- Vypisuji data pro tabulku `ObjectGroup`
70--
71
72INSERT INTO `ObjectGroup` (`Id`, `Name`, `Parent`, `Sequence`) VALUES
73(1, 'Síť', 0, 0),
74(2, 'Finance', 0, 0),
75(3, 'Portál', 0, 0),
76(4, 'Obecné', 0, 0),
77(5, 'Systémové', 0, 0);
78
79-- --------------------------------------------------------
80
81--
82-- Struktura tabulky `Property`
83--
84
85CREATE TABLE IF NOT EXISTS `Property` (
86 `Id` int(11) NOT NULL AUTO_INCREMENT,
87 `Name` varchar(255) NOT NULL,
88 `Object` int(11) NOT NULL,
89 `PropertyGroup` int(11) NOT NULL,
90 `Type` int(11) NOT NULL,
91 `ColumnName` varchar(255) NOT NULL,
92 PRIMARY KEY (`Id`),
93 KEY `Object` (`Object`),
94 KEY `PropertyGroup` (`PropertyGroup`),
95 KEY `Type` (`Type`)
96) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=41 ;
97
98--
99-- Vypisuji data pro tabulku `Property`
100--
101
102INSERT INTO `Property` (`Id`, `Name`, `Object`, `PropertyGroup`, `Type`, `ColumnName`) VALUES
103(1, 'IP adresa', 2, 0, 1, 'IPAddress'),
104(2, 'Kód banky', 4, 0, 1, 'BankCode'),
105(3, 'Číslo', 4, 0, 1, 'Number'),
106(4, 'Název', 1, 0, 1, 'Name'),
107(5, 'Jméno', 5, 0, 1, 'Name'),
108(6, 'Ulice', 5, 0, 1, 'AddressStreet'),
109(7, 'Město', 5, 0, 1, 'AddressTown'),
110(8, 'PSČ', 5, 0, 1, 'AddressPSC'),
111(9, 'IČ', 5, 0, 1, 'IC'),
112(10, 'DIČ', 5, 0, 1, 'DIC'),
113(11, 'WWW', 5, 0, 1, 'WWW'),
114(12, 'Přihlašovací jméno', 6, 0, 2, 'Login'),
115(13, 'Jméno', 6, 0, 2, 'Name'),
116(14, 'Heslo', 6, 0, 15, 'Password'),
117(15, 'E-mail', 6, 0, 2, 'Email'),
118(16, 'IP posledního přístupu', 6, 0, 18, 'LastIpAddress'),
119(17, 'Čas posledního přístupu', 6, 0, 4, 'LastLoginTime'),
120(18, 'Čas registrace', 6, 0, 4, 'RegistrationTime'),
121(19, 'Členství', 6, 0, 16, 'Member'),
122(20, 'Uzamčeno', 6, 0, 7, 'Locked'),
123(21, 'ICQ', 6, 0, 1, 'ICQ'),
124(22, 'Telefoní číslo', 6, 0, 2, 'PhoneNumber'),
125(23, 'Jméno', 9, 0, 2, 'Name'),
126(24, 'Skupina', 9, 0, 16, 'MenuGroup'),
127(25, 'Schéma', 9, 0, 2, 'Schema'),
128(26, 'Tabulka', 9, 0, 2, 'Table'),
129(27, 'Primární klíč', 9, 0, 2, 'PrimaryKey'),
130(28, 'Pořadí', 9, 0, 1, 'Sequence'),
131(29, 'Jméno', 12, 0, 2, 'Name'),
132(30, 'Objekt', 12, 0, 16, 'Object'),
133(31, 'Jméno', 8, 0, 2, 'Name'),
134(32, 'Rodič', 8, 0, 12, 'Parent'),
135(33, 'Pořadí', 8, 0, 1, 'Sequence'),
136(34, 'Jméno', 13, 0, 2, 'Name'),
137(35, 'Ukazovat jako online', 13, 0, 7, 'ShowOnline'),
138(36, 'Jméno ikony', 13, 0, 2, 'IconName'),
139(37, 'Jméno', 14, 0, 2, 'Name'),
140(38, 'Max. rychlost', 14, 0, 1, 'MaxSpeed'),
141(39, 'Plně duplexní', 14, 0, 7, 'FullDuplex'),
142(40, 'Barva', 14, 0, 19, '');
143
144-- --------------------------------------------------------
145
146--
147-- Struktura tabulky `PropertyGroup`
148--
149
150CREATE TABLE IF NOT EXISTS `PropertyGroup` (
151 `Id` int(11) NOT NULL AUTO_INCREMENT,
152 `Object` int(11) NOT NULL,
153 `Name` varchar(255) NOT NULL,
154 PRIMARY KEY (`Id`),
155 KEY `Object` (`Object`)
156) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
157
158--
159-- Vypisuji data pro tabulku `PropertyGroup`
160--
161
162INSERT INTO `PropertyGroup` (`Id`, `Object`, `Name`) VALUES
163(1, 6, 'Základní');
164
165-- --------------------------------------------------------
166
167--
168-- Struktura tabulky `Type`
169--
170
171CREATE TABLE IF NOT EXISTS `Type` (
172 `Id` int(11) NOT NULL AUTO_INCREMENT,
173 `Name` varchar(255) NOT NULL,
174 `DbType` varchar(255) NOT NULL,
175 `Parent` int(11) NOT NULL,
176 `ParameterTable` varchar(255) NOT NULL,
177 PRIMARY KEY (`Id`)
178) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
179
180--
181-- Vypisuji data pro tabulku `Type`
182--
183
184INSERT INTO `Type` (`Id`, `Name`, `DbType`, `Parent`, `ParameterTable`) VALUES
185(1, 'Číslo', 'INT', 0, ''),
186(2, 'Řetězec', 'VARCHAR(255)', 0, ''),
187(3, 'Text', 'TEXT', 0, ''),
188(4, 'Datum a čas', 'DATETIME', 0, ''),
189(5, 'Desetinné číslo', 'FLOAT', 0, ''),
190(6, 'Obrázek', 'BLOB', 0, ''),
191(7, 'Logická hodnota', 'INT', 13, ''),
192(8, 'IPv4', 'BINARY(4)', 0, ''),
193(9, 'MAC adresa', 'BINARY(6)', 0, ''),
194(10, 'IPv6', 'BINARY(16)', 0, ''),
195(11, 'Soubor', '', 0, ''),
196(12, 'GPS', '', 0, ''),
197(13, 'Výčet', 'INT', 0, 'TypeEnumeration'),
198(14, 'Internetový odkaz', 'VARCHAR(255)', 1, ''),
199(15, 'Heslo', 'VARCHAR(255)', 2, ''),
200(16, 'Ukazatel', 'INT', 0, 'TypePointer'),
201(17, 'Datum', 'DATE', 0, ''),
202(18, 'Čas', 'TIME', 0, ''),
203(19, 'Barva', 'INT', 0, '');
204
205-- --------------------------------------------------------
206
207--
208-- Struktura tabulky `TypeEnumeration`
209--
210
211CREATE TABLE IF NOT EXISTS `TypeEnumeration` (
212 `Id` int(11) NOT NULL AUTO_INCREMENT,
213 `Name` varchar(255) NOT NULL,
214 `Type` int(11) NOT NULL,
215 `Sequence` int(11) NOT NULL,
216 PRIMARY KEY (`Id`),
217 KEY `Type` (`Type`)
218) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
219
220--
221-- Vypisuji data pro tabulku `TypeEnumeration`
222--
223
224INSERT INTO `TypeEnumeration` (`Id`, `Name`, `Type`, `Sequence`) VALUES
225(1, 'Nepravda', 7, 0),
226(2, 'Pravda', 7, 1);
227
228-- --------------------------------------------------------
229
230--
231-- Struktura tabulky `TypeFile`
232--
233
234CREATE TABLE IF NOT EXISTS `TypeFile` (
235 `Id` int(11) NOT NULL AUTO_INCREMENT,
236 `Name` varchar(255) NOT NULL,
237 `Size` int(11) NOT NULL,
238 PRIMARY KEY (`Id`)
239) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
240
241--
242-- Vypisuji data pro tabulku `TypeFile`
243--
244
245
246-- --------------------------------------------------------
247
248--
249-- Struktura tabulky `TypeGPS`
250--
251
252CREATE TABLE IF NOT EXISTS `TypeGPS` (
253 `Id` int(11) NOT NULL AUTO_INCREMENT,
254 `Latitude` double NOT NULL,
255 `Longitude` double NOT NULL,
256 PRIMARY KEY (`Id`)
257) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
258
259--
260-- Vypisuji data pro tabulku `TypeGPS`
261--
262
263
264-- --------------------------------------------------------
265
266--
267-- Struktura tabulky `TypePointer`
268--
269
270CREATE TABLE IF NOT EXISTS `TypePointer` (
271 `Id` int(11) NOT NULL AUTO_INCREMENT,
272 `Type` int(11) NOT NULL,
273 `Object` int(11) NOT NULL,
274 PRIMARY KEY (`Id`),
275 KEY `Type` (`Type`)
276) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
277
278--
279-- Vypisuji data pro tabulku `TypePointer`
280--
281
282
283--
284-- Omezení pro exportované tabulky
285--
286
287--
288-- Omezení pro tabulku `Object`
289--
290ALTER TABLE `Object`
291 ADD CONSTRAINT `Object_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `ObjectGroup` (`Id`);
292
293--
294-- Omezení pro tabulku `Property`
295--
296ALTER TABLE `Property`
297 ADD CONSTRAINT `Property_ibfk_1` FOREIGN KEY (`Object`) REFERENCES `Object` (`Id`),
298 ADD CONSTRAINT `Property_ibfk_2` FOREIGN KEY (`Type`) REFERENCES `Type` (`Id`);
299
300--
301-- Omezení pro tabulku `PropertyGroup`
302--
303ALTER TABLE `PropertyGroup`
304 ADD CONSTRAINT `PropertyGroup_ibfk_1` FOREIGN KEY (`Object`) REFERENCES `Object` (`Id`);
305
306--
307-- Omezení pro tabulku `TypeEnumeration`
308--
309ALTER TABLE `TypeEnumeration`
310 ADD CONSTRAINT `TypeEnumeration_ibfk_1` FOREIGN KEY (`Type`) REFERENCES `Type` (`Id`);
311
312--
313-- Omezení pro tabulku `TypePointer`
314--
315ALTER TABLE `TypePointer`
316 ADD CONSTRAINT `TypePointer_ibfk_1` FOREIGN KEY (`Type`) REFERENCES `Type` (`Id`);
Note: See TracBrowser for help on using the repository browser.