ALTER TABLE `group` ADD `MangosDatabase` VARCHAR( 255 ) NOT NULL AFTER `TablePrefix`;
UPDATE `group` SET `MangosDatabase` = "mangos";
UPDATE `group` SET `MangosDatabase` = '' WHERE `group`.`Id` =9 LIMIT 1 ;

INSERT INTO `group` (
`Id` ,
`Name` ,
`TablePrefix` ,
`MangosDatabase` ,
`MangosTable` ,
`MangosTableIndex`
)
VALUES (
NULL , 'Texty skriptů', 'sd2_script_texts', 'scriptdev2', 'script_texts', 'entry'
), (
NULL , 'Texty EventAI', 'sd2_eventai_texts', 'scriptdev2', 'eventai_texts', 'entry'
);

CREATE TABLE IF NOT EXISTS `sd2_script_texts` (
`ID` int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
`entry` int( 11 ) NOT NULL ,
`Language` int( 11 ) NOT NULL default '0',
`Vote` float NOT NULL ,
`CountVote` int( 11 ) NOT NULL ,
`User` int( 11 ) NOT NULL ,
`Complete` int( 11 ) NOT NULL ,
`Take` int( 11 ) NOT NULL ,
`admin_check` int( 11 ) NOT NULL default '0',
PRIMARY KEY ( `ID` ) ,
KEY `entry` ( `entry` ) ,
KEY `User` ( `User` ) ,
KEY `Take` ( `Take` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

CREATE TABLE IF NOT EXISTS `sd2_script_texts_vote` (
`ID` int( 11 ) NOT NULL AUTO_INCREMENT ,
`TextId` int( 11 ) NOT NULL ,
`IDuser` int( 11 ) NOT NULL ,
`vote` int( 11 ) NOT NULL ,
PRIMARY KEY ( `ID` ) ,
KEY `IDquest` ( `TextId` ) ,
KEY `IDuser` ( `IDuser` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

CREATE TABLE IF NOT EXISTS `sd2_eventai_texts` (
`ID` int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
`entry` int( 11 ) NOT NULL ,
`Language` int( 11 ) NOT NULL default '0',
`Vote` float NOT NULL ,
`CountVote` int( 11 ) NOT NULL ,
`User` int( 11 ) NOT NULL ,
`Complete` int( 11 ) NOT NULL ,
`Take` int( 11 ) NOT NULL ,
`admin_check` int( 11 ) NOT NULL default '0',
PRIMARY KEY ( `ID` ) ,
KEY `entry` ( `entry` ) ,
KEY `User` ( `User` ) ,
KEY `Take` ( `Take` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

CREATE TABLE IF NOT EXISTS `sd2_eventai_texts_vote` (
`ID` int( 11 ) NOT NULL AUTO_INCREMENT ,
`TextId` int( 11 ) NOT NULL ,
`IDuser` int( 11 ) NOT NULL ,
`vote` int( 11 ) NOT NULL ,
PRIMARY KEY ( `ID` ) ,
KEY `IDquest` ( `TextId` ) ,
KEY `IDuser` ( `IDuser` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;
