source: trunk/sql/updates/635.sql

Last change on this file was 636, checked in by george, 15 years ago
  • Opraveno: Načítání RSS aktualit z nově upravené tabulky.
File size: 1.0 KB
Line 
1ALTER TABLE `articles` CHANGE `id` `Id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
2CHANGE `title` `Title` TEXT CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ,
3CHANGE `autor` `Author` TEXT CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ,
4CHANGE `category` `Category` INT( 11 ) NOT NULL DEFAULT '0',
5CHANGE `text` `Content` TEXT CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL ,
6CHANGE `date` `Time` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00';
7
8RENAME TABLE `articles` TO `Article` ;
9ALTER TABLE `Article` ENGINE = InnoDB;
10
11ALTER TABLE `Article` ADD INDEX ( `Category` ) ;
12
13CREATE TABLE IF NOT EXISTS `ArticleCategory` (
14 `Id` int(11) NOT NULL auto_increment,
15 `Name` varchar(255) NOT NULL,
16 PRIMARY KEY (`Id`)
17) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
18
19INSERT INTO `ArticleCategory` (`Id`, `Name`) VALUES
20(1, 'Server novinky'),
21(2, 'GM novinky'),
22(3, 'In-game novinky'),
23(4, 'Články');
24
25ALTER TABLE `Article` ADD FOREIGN KEY ( `Category` ) REFERENCES `ArticleCategory` (`Id`);
Note: See TracBrowser for help on using the repository browser.