CREATE TABLE IF NOT EXISTS `File` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Location` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  `Time` datetime NOT NULL,
  `Category` int(11) NOT NULL,
  `Description` text COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`),
  KEY `Category` (`Category`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=9 ;



CREATE TABLE IF NOT EXISTS `FileCategory` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ;


INSERT INTO `FileCategory` (`Id`, `Name`) VALUES
(1, 'Herní klient WoW'),
(2, 'Čeština pro klienta');


ALTER TABLE `File`
  ADD CONSTRAINT `File_ibfk_1` FOREIGN KEY (`Category`) REFERENCES `FileCategory` (`Id`);
