ALTER TABLE `WideSlideContent` ADD CONSTRAINT `WideSlideContent_ibfk_1` FOREIGN KEY (`id`) REFERENCES `WideSlide` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `WideSlideContent_ibfk_2` FOREIGN KEY (`lang`) REFERENCES `DLanguage` (`name`); ------ ------ ------ CREATE TABLE IF NOT EXISTS `SettingsContent` ( `name` varchar(255) NOT NULL, `lang` varchar(3) NOT NULL, `value` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `SettingsContent` ADD PRIMARY KEY (`name`,`lang`), ADD KEY `lang` (`lang`); ----- ----- ----- CREATE TABLE `ResultTextContent` AS SELECT * FROM `ResultText`; ALTER TABLE `ResultTextContent` ADD `lang` VARCHAR(3) NOT NULL AFTER `id`; ALTER TABLE `ResultTextContent` ADD PRIMARY KEY (`id`,`lang`), ADD KEY `lang` (`lang`); UPDATE `ResultTextContent` SET `lang` = 'en'; ALTER TABLE `ResultTextContent` ADD CONSTRAINT `ResultTextContent_ibfk_1` FOREIGN KEY (`id`) REFERENCES `ResultText` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `ResultTextContent_ibfk_2` FOREIGN KEY (`lang`) REFERENCES `DLanguage` (`name`); ALTER TABLE `ResultTextContent` DROP `name`, DROP `added`, DROP `changed`; ALTER TABLE `ResultText` DROP `description`; ------- ------- ------- CREATE TABLE `HintContent` AS SELECT * FROM `Hint`; ALTER TABLE `HintContent` ADD `lang` VARCHAR(3) NOT NULL AFTER `id`; ALTER TABLE `HintContent` ADD PRIMARY KEY (`id`,`lang`), ADD KEY `lang` (`lang`); UPDATE `HintContent` SET `lang` = 'en'; ALTER TABLE `HintContent` ADD CONSTRAINT `HintContent_ibfk_1` FOREIGN KEY (`id`) REFERENCES `Hint` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `HintContent_ibfk_2` FOREIGN KEY (`lang`) REFERENCES `DLanguage` (`name`); ALTER TABLE `HintContent` DROP `name`, DROP `label`, DROP `added`, DROP `changed`; ALTER TABLE `Hint` DROP `description`;