Changeset 30 for install


Ignore:
Timestamp:
Dec 16, 2008, 8:15:34 AM (16 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro určování v definicích krom tabulky také jméno databáze a jméno primárního identifikačního sloupce.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • install/system_init.php

    r29 r30  
    11<?php
    22
    3 $SytemList = array();
     3function TableStructure()
     4{
     5  global $Database;
     6 
     7  $Database->query('CREATE TABLE IF NOT EXISTS `SystemType` (
     8  `Id` int(11) NOT NULL auto_increment,
     9  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     10  `Description` varchar(255) collate utf8_czech_ci NOT NULL,
     11  `ParentType` int(255) NOT NULL,
     12  `Parameters` varchar(255) collate utf8_czech_ci NOT NULL,
     13  `System` tinyint(1) NOT NULL default '0',
     14  `DbDataType` varchar(255) collate utf8_czech_ci NOT NULL,
     15  `ParameterList` int(11) NOT NULL,
     16  PRIMARY KEY  (`Id`)
     17) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     18  $Database->query("INSERT INTO `SystemType` (`Id`, `Name`, `Description`, `ParentType`, `Parameters`, `System`, `DbDataType`, `ParameterList`) VALUES
     19(1, 'Integer', 'Číslo', 0, '', 1, 'INT', 0),
     20(2, 'Date', 'Datum', 0, '', 1, 'DATE', 0),
     21(3, 'String', 'Řetězec', 0, '', 1, 'VARCHAR(255)', 0),
     22(4, 'Boolean', 'Logická hodnota', 0, '', 1, 'BOOL', 0),
     23(5, 'Float', 'Desetinné číslo', 0, '', 1, 'FLOAT', 0),
     24(6, 'Enumeration', 'Výčet', 0, '', 0, 'INT', 0),
     25(7, 'PointerOneToOne', 'Ukazatel na jednu položku', 0, '', 1, 'INT', 0),
     26(8, 'PointerOneToMany', 'Ukazatel na více položek', 0, '', 1, 'INT', 0),
     27(9, 'Password', 'Heslo', 0, '', 1, 'INT', 0),
     28(10, 'Hyperlink', 'Internetový odkaz', 0, '', 0, 'VARCHAR(255)', 0),
     29(11, 'IPv4Address', 'IP adresa v4', 0, '', 0, 'VARCHAR(16)', 0),
     30(12, 'Hidden', 'Skrytá položka formuláře', 0, '', 1, 'VARCHAR(255)', 0),
     31(13, 'DateTime', 'Datum a čas', 0, '', 1, 'DATETIME', 0),
     32(14, 'File', 'Soubor', 0, '', 1, 'INT', 0),
     33(15, 'GPS', 'Zemská souřadnice', 0, '', 1, 'INT', 0),
     34(16, 'MySQLDataTypes', 'Databázový datový typ ', 14, 'INT|VARCHAR(255)|TEXT|FLOAT|DOUBLE|TIME|DATE|DATETIME|', 1, 'INT', 0),
    435
     36(17, 'Sex', 'Pohlaví', 14, 'Muž|Žena', 0, 'INT', 0),
     37(18, 'PointerToSystemListItemList', '', 13, 'SystemListItem|List', 0, 'INT', 0),
     38(19, 'PointerToSystemList', '', 12, 'SystemList', 0, 'INT', 0),
     39(20, 'PointerToSystemType', '', 12, 'SystemType', 0, 'INT', 0),
     40(21, 'PointerToMenu', 'Ukazatel na menu', 12, 'SystemMenu', 0, 'INT', 0),
     41(22, 'PointerToSystemListMenu', 'Položky menu', 13, 'SystemList|Menu', 0, 'INT', 0),
     42(23, 'PointerToSystemTypeParameter', 'Ukazatel na seznam paramtrů', 13, 'SystemTypeParameter|ParentType', 0, 'INT', 0),
     43(24, 'PointerToSystemEnumerationState', 'Seznam stavů výčtu', 13, 'SystemEnumerationState|ParentType', 0, 'INT', 0);");
     44
     45  $Database->query('CREATE TABLE IF NOT EXISTS `SystemEnumerationState` (
     46  `Id` int(11) NOT NULL auto_increment,
     47  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     48  `ParentParameter` int(11) NOT NULL,
     49  PRIMARY KEY  (`Id`)
     50) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     51  $Database->query('CREATE TABLE IF NOT EXISTS `SystemFile` (
     52  `Id` int(11) NOT NULL auto_increment,
     53  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     54  `Size` int(11) NOT NULL,
     55  PRIMARY KEY  (`Id`)
     56) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     57  $Database->query('CREATE TABLE IF NOT EXISTS `SystemGPS` (
     58  `Id` int(11) NOT NULL auto_increment,
     59  `Longitude` double NOT NULL,
     60  `Latitude` double NOT NULL,
     61  PRIMARY KEY  (`Id`)
     62) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     63  $Database->query('CREATE TABLE IF NOT EXISTS `SystemList` (
     64  `Id` int(11) NOT NULL auto_increment,
     65  `TableName` varchar(255) collate utf8_czech_ci NOT NULL,
     66  `Title` varchar(255) collate utf8_czech_ci NOT NULL,
     67  `Items` varchar(255) collate utf8_czech_ci NOT NULL,
     68  `Menu` int(11) NOT NULL,
     69  `Sequence` int(11) NOT NULL,
     70  PRIMARY KEY  (`Id`)
     71) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     72  $Database->query('CREATE TABLE IF NOT EXISTS `SystemListItem` (
     73  `Id` int(11) NOT NULL auto_increment,
     74  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     75  `TextBefore` varchar(255) collate utf8_czech_ci NOT NULL,
     76  `TextAfter` varchar(255) collate utf8_czech_ci NOT NULL,
     77  `Type` varchar(255) collate utf8_czech_ci NOT NULL,
     78  `Help` varchar(255) collate utf8_czech_ci NOT NULL,
     79  `Default` varchar(255) collate utf8_czech_ci NOT NULL,
     80  `Required` tinyint(1) NOT NULL default '1',
     81  `Editable` tinyint(1) NOT NULL default '1',
     82  `VisibleInList` tinyint(1) NOT NULL default '0',
     83  `VisibleInPointer` tinyint(1) NOT NULL default '0',
     84  `List` int(11) NOT NULL,
     85  `Sequence` int(11) NOT NULL,
     86  PRIMARY KEY  (`Id`)
     87) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     88  $Database->query('CREATE TABLE IF NOT EXISTS `SystemLog` (
     89  `Id` int(11) NOT NULL auto_increment,
     90  `User` int(11) NOT NULL,
     91  `List` int(11) NOT NULL,
     92  `Item` int(11) NOT NULL,
     93  `Action` int(11) NOT NULL,
     94  PRIMARY KEY  (`Id`)
     95) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     96  $Database->query('CREATE TABLE IF NOT EXISTS `SystemMenu` (
     97  `Id` int(11) NOT NULL auto_increment,
     98  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     99  `SystemListItems` int(11) NOT NULL,
     100  `Sequence` int(11) NOT NULL,
     101  PRIMARY KEY  (`Id`)
     102) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     103  $Database->query('CREATE TABLE IF NOT EXISTS `SystemType` (
     104  `Id` int(11) NOT NULL auto_increment,
     105  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     106  `Description` varchar(255) collate utf8_czech_ci NOT NULL,
     107  `ParentType` int(255) NOT NULL,
     108  `Parameters` varchar(255) collate utf8_czech_ci NOT NULL,
     109  `System` tinyint(1) NOT NULL default '0',
     110  `DbDataType` varchar(255) collate utf8_czech_ci NOT NULL,
     111  `ParameterList` int(11) NOT NULL,
     112  PRIMARY KEY  (`Id`)
     113) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     114  $Database->query('CREATE TABLE IF NOT EXISTS `SystemTypeParameter` (
     115  `Id` int(11) NOT NULL auto_increment,
     116  `Name` varchar(255) collate utf8_czech_ci NOT NULL,
     117  `Type` int(11) NOT NULL,
     118  `ParentType` int(11) NOT NULL,
     119  `Description` varchar(255) collate utf8_czech_ci NOT NULL,
     120  PRIMARY KEY  (`Id`)
     121) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci');
     122  $Database->query('CREATE TABLE IF NOT EXISTS `SystemTypeParameterValue` (
     123  `Id` int(11) NOT NULL auto_increment,
     124  PRIMARY KEY  (`Id`)
     125) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;');
     126  $Database->query('CREATE TABLE IF NOT EXISTS `User` (
     127  `Id` int(11) NOT NULL auto_increment,
     128  `UserName` varchar(255) collate utf8_czech_ci NOT NULL,
     129  `Password` varchar(255) collate utf8_czech_ci NOT NULL,
     130  `FirstName` varchar(255) character set ucs2 collate ucs2_czech_ci NOT NULL,
     131  `SecondName` varchar(255) character set ucs2 collate ucs2_czech_ci NOT NULL,
     132  `Email` varchar(255) character set ucs2 collate ucs2_czech_ci NOT NULL,
     133  `ICQ` int(11) NOT NULL,
     134  `Sex` int(11) NOT NULL default '0',
     135  `BirthDay` date NOT NULL,
     136  `Phone` varchar(255) collate utf8_czech_ci NOT NULL,
     137  `Member` int(11) NOT NULL,
     138  `RegistrationTime` datetime NOT NULL,
     139  `LastLoginTime` datetime NOT NULL,
     140  `Locked` tinyint(1) NOT NULL,
     141  `LastIpAddress` varchar(255) collate utf8_czech_ci NOT NULL,
     142  `PermissionGroup` int(11) NOT NULL,
     143  PRIMARY KEY  (`Id`)
     144) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci');
     145  $Database->query('CREATE TABLE IF NOT EXISTS `UserOnline` (
     146  `User` int(11) NOT NULL,
     147  `LoginTime` datetime NOT NULL,
     148  `ActivityTime` datetime NOT NULL,
     149  `SessionId` varchar(255) collate utf8_czech_ci NOT NULL,
     150  `IpAddress` varchar(16) collate utf8_czech_ci NOT NULL,
     151  `HostName` varchar(255) collate utf8_czech_ci NOT NULL,
     152  `Id` int(11) NOT NULL auto_increment,
     153  PRIMARY KEY  (`Id`),
     154  KEY `User` (`User`)
     155) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci');
     156
     157}
     158
     159function LoadInitData()
     160{
     161
     162}
    5163
    6164?>
Note: See TracChangeset for help on using the changeset viewer.