source: trunk/www/SQL/Updates/54.sql

Last change on this file was 69, checked in by george, 15 years ago
  • Rozpracovaná verze.
  • Přeorganizována struktura souborů projektu.
  • Názvy přepány na stejné s prvním velkým písmenem.
  • Uživatelské podsložky přesunuty do podsložky Application, systémové do podsložky Base.
  • Použití koncepce Model-View-Controller.
File size: 1.2 KB
Line 
1CREATE TABLE IF NOT EXISTS `Realm` (
2 `Id` int(11) NOT NULL auto_increment,
3 `Name` varchar(255) NOT NULL,
4 `Database` int(11) NOT NULL,
5 `Server` int(11) NOT NULL,
6 `NetworkPortWorldd` int(11) NOT NULL,
7 `Motd` varchar(255) NOT NULL,
8 `Description` text NOT NULL,
9 `Type` int(11) NOT NULL,
10 `Homepage` varchar(255) NOT NULL,
11 `TimeCreate` datetime NOT NULL,
12 `Online` int(11) NOT NULL,
13 `CharacterOnlineCount` int(11) NOT NULL,
14 `CharacterCount` int(11) NOT NULL,
15 `AccountCount` int(11) NOT NULL,
16 `Lock` int(11) NOT NULL,
17 PRIMARY KEY (`Id`),
18 KEY `Database` (`Database`),
19 KEY `Server` (`Server`)
20) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
21
22ALTER TABLE `Realm`
23 ADD CONSTRAINT `Realm_ibfk_1` FOREIGN KEY (`Server`) REFERENCES `Server` (`Id`);
24ALTER TABLE `Realm` ADD FOREIGN KEY ( `Database` ) REFERENCES `Database` (`Id`);
25
26INSERT INTO `Realm` (SELECT 0 AS `Id`, "" AS `Name`, `Server`.`Database` AS `Database`, `Server`.`Id` AS `Server`, `NetworkPortWorldd`, `Motd`, "" AS `Description`, `Type`, "" AS `Homepage`, `TimeCreate`, 0 AS `Online`, `CharacterOnlineCount`, `CharacterCount`, `AccountCount`, 0 AS `Lock` FROM `Server`);
27
28ALTER TABLE `Server` DROP `NetworkPortWorldd` , DROP `Motd` , DROP `Type` ;
Note: See TracBrowser for help on using the repository browser.