
#03.07.2013
CREATE TABLE IF NOT EXISTS `glossary_glossary` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `status` enum('Enabled','Disabled') NOT NULL DEFAULT 'Enabled',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `glossary_glossary_i18n` (
  `id` int(10) unsigned NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `keywords` varchar(255) NOT NULL,
  `locale` varchar(5) NOT NULL DEFAULT 'en_US',
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

INSERT INTO glossary_glossary (id) SELECT id FROM glossary_glossaryDescription;

INSERT INTO glossary_glossary_i18n (id, title, content, keywords)
SELECT a.id, a.title, a.content, GROUP_CONCAT( DISTINCT b.title ORDER BY b.descId SEPARATOR ', ' ) AS keywords 
FROM `glossary_glossaryDescription` a LEFT JOIN `glossary_glossaryKeyword` b ON a.id = b.descId GROUP BY a.id;

DROP TABLE `glossary_glossaryKeyword`;
DROP TABLE `glossary_glossaryDescription`;

