Execute(" CREATE TABLE IF NOT EXISTS `Meals` ( `Date` date NOT NULL DEFAULT '0000-00-00', `Soup` varchar(255) NOT NULL, `Meal` varchar(255) NOT NULL, `Status` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Struktura tabulky `MealsInfo` -- CREATE TABLE IF NOT EXISTS `MealsInfo` ( `Info` text NOT NULL, `Price` int(11) NOT NULL DEFAULT '0', `Cook` varchar(255) NOT NULL, `PrintInfo` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- -- -- Struktura tabulky `Module` -- CREATE TABLE IF NOT EXISTS `Module` ( `Id` int(11) NOT NULL, `Name` varchar(255) NOT NULL, `Title` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ; -- -------------------------------------------------------- -- -- Struktura tabulky `PermissionGroup` -- CREATE TABLE IF NOT EXISTS `PermissionGroup` ( `Id` int(11) NOT NULL, `Description` varchar(255) NOT NULL DEFAULT '' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ; -- -------------------------------------------------------- -- -- Struktura tabulky `PermissionGroupAssignment` -- CREATE TABLE IF NOT EXISTS `PermissionGroupAssignment` ( `Id` int(11) NOT NULL, `Group` int(11) NOT NULL DEFAULT '0', `AssignedGroup` int(11) DEFAULT NULL, `AssignedOperation` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=48 ; -- -- RELACE PRO TABULKU `PermissionGroupAssignment`: -- `Group` -- `PermissionGroup` -> `Id` -- `AssignedGroup` -- `PermissionGroup` -> `Id` -- `AssignedOperation` -- `PermissionOperation` -> `Id` -- -- -------------------------------------------------------- -- -- Struktura tabulky `PermissionOperation` -- CREATE TABLE IF NOT EXISTS `PermissionOperation` ( `Id` int(11) NOT NULL, `Module` int(11) NOT NULL, `Operation` varchar(128) NOT NULL DEFAULT '', `Item` varchar(64) NOT NULL DEFAULT '', `ItemId` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=47 ; -- -- RELACE PRO TABULKU `PermissionOperation`: -- `Module` -- `Module` -> `Id` -- -- -------------------------------------------------------- -- -- Struktura tabulky `PermissionUserAssignment` -- CREATE TABLE IF NOT EXISTS `PermissionUserAssignment` ( `Id` int(11) NOT NULL, `User` int(11) DEFAULT NULL, `AssignedGroup` int(11) DEFAULT NULL, `AssignedOperation` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=248 ; -- -- RELACE PRO TABULKU `PermissionUserAssignment`: -- `AssignedGroup` -- `PermissionGroup` -> `Id` -- `AssignedOperation` -- `PermissionOperation` -> `Id` -- `User` -- `User` -> `Id` -- -- -------------------------------------------------------- -- -- Struktura tabulky `SystemVersion` -- CREATE TABLE IF NOT EXISTS `SystemVersion` ( `Id` int(11) NOT NULL, `Revision` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; -- -------------------------------------------------------- -- -- Struktura tabulky `User` -- CREATE TABLE IF NOT EXISTS `User` ( `Id` int(11) NOT NULL, `Login` varchar(64) NOT NULL, `Name` varchar(128) NOT NULL, `Password` varchar(255) NOT NULL, `Salt` varchar(255) NOT NULL, `Email` varchar(128) NOT NULL DEFAULT '', `LastIpAddress` varchar(16) NOT NULL DEFAULT '', `LastLoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `Locked` tinyint(1) NOT NULL DEFAULT '0', `InitPassword` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=273 ; -- -------------------------------------------------------- -- -- Struktura tabulky `UserOnline` -- CREATE TABLE IF NOT EXISTS `UserOnline` ( `Id` int(11) NOT NULL, `User` int(11) DEFAULT NULL COMMENT 'User.Id', `ActivityTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `LoginTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `SessionId` varchar(255) NOT NULL DEFAULT '', `IpAddress` varchar(16) NOT NULL DEFAULT '', `HostName` varchar(255) NOT NULL DEFAULT '', `ScriptName` varchar(255) NOT NULL, `StayLogged` int(11) NOT NULL, `StayLoggedHash` varchar(40) NOT NULL ) ENGINE=MEMORY DEFAULT CHARSET=utf8 AUTO_INCREMENT=7419 ; -- -- Klíče pro exportované tabulky -- -- -- Klíče pro tabulku `Meals` -- ALTER TABLE `Meals` ADD UNIQUE KEY `date` (`Date`); -- -- Klíče pro tabulku `Module` -- ALTER TABLE `Module` ADD PRIMARY KEY (`Id`); -- -- Klíče pro tabulku `PermissionGroup` -- ALTER TABLE `PermissionGroup` ADD PRIMARY KEY (`Id`); -- -- Klíče pro tabulku `PermissionGroupAssignment` -- ALTER TABLE `PermissionGroupAssignment` ADD PRIMARY KEY (`Id`), ADD KEY `Group` (`Group`), ADD KEY `AssignedGroup` (`AssignedGroup`), ADD KEY `AssignedOperation` (`AssignedOperation`); -- -- Klíče pro tabulku `PermissionOperation` -- ALTER TABLE `PermissionOperation` ADD PRIMARY KEY (`Id`), ADD KEY `Module` (`Module`), ADD KEY `Operation` (`Operation`), ADD KEY `Item` (`Item`), ADD KEY `ItemId` (`ItemId`); -- -- Klíče pro tabulku `PermissionUserAssignment` -- ALTER TABLE `PermissionUserAssignment` ADD PRIMARY KEY (`Id`), ADD KEY `User` (`User`), ADD KEY `AssignedGroup` (`AssignedGroup`), ADD KEY `AssignedOperation` (`AssignedOperation`); -- -- Klíče pro tabulku `SystemVersion` -- ALTER TABLE `SystemVersion` ADD PRIMARY KEY (`Id`); -- -- Klíče pro tabulku `User` -- ALTER TABLE `User` ADD PRIMARY KEY (`Id`), ADD UNIQUE KEY `Name` (`Login`), ADD UNIQUE KEY `Nick` (`Name`); -- -- Klíče pro tabulku `UserOnline` -- ALTER TABLE `UserOnline` ADD PRIMARY KEY (`Id`), ADD KEY `User` (`User`); -- -- AUTO_INCREMENT pro tabulky -- -- -- AUTO_INCREMENT pro tabulku `Module` -- ALTER TABLE `Module` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=35; -- -- AUTO_INCREMENT pro tabulku `PermissionGroup` -- ALTER TABLE `PermissionGroup` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8; -- -- AUTO_INCREMENT pro tabulku `PermissionGroupAssignment` -- ALTER TABLE `PermissionGroupAssignment` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=48; -- -- AUTO_INCREMENT pro tabulku `PermissionOperation` -- ALTER TABLE `PermissionOperation` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=47; -- -- AUTO_INCREMENT pro tabulku `PermissionUserAssignment` -- ALTER TABLE `PermissionUserAssignment` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=248; -- -- AUTO_INCREMENT pro tabulku `SystemVersion` -- ALTER TABLE `SystemVersion` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2; -- -- AUTO_INCREMENT pro tabulku `User` -- ALTER TABLE `User` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=273; -- -- AUTO_INCREMENT pro tabulku `UserOnline` -- ALTER TABLE `UserOnline` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7419; -- -- Omezení pro exportované tabulky -- -- -- Omezení pro tabulku `PermissionGroupAssignment` -- ALTER TABLE `PermissionGroupAssignment` ADD CONSTRAINT `PermissionGroupAssignment_ibfk_1` FOREIGN KEY (`Group`) REFERENCES `PermissionGroup` (`Id`), ADD CONSTRAINT `PermissionGroupAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`), ADD CONSTRAINT `PermissionGroupAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`); -- -- Omezení pro tabulku `PermissionOperation` -- ALTER TABLE `PermissionOperation` ADD CONSTRAINT `PermissionOperation_ibfk_1` FOREIGN KEY (`Module`) REFERENCES `Module` (`Id`); -- -- Omezení pro tabulku `PermissionUserAssignment` -- ALTER TABLE `PermissionUserAssignment` ADD CONSTRAINT `PermissionUserAssignment_ibfk_2` FOREIGN KEY (`AssignedGroup`) REFERENCES `PermissionGroup` (`Id`), ADD CONSTRAINT `PermissionUserAssignment_ibfk_3` FOREIGN KEY (`AssignedOperation`) REFERENCES `PermissionOperation` (`Id`), ADD CONSTRAINT `PermissionUserAssignment_ibfk_4` FOREIGN KEY (`User`) REFERENCES `User` (`Id`);"); }