<?php
/**
 * JComments Subscriptions Table ETL for #__jcomments_subscriptions
 * 
 * @version 2.0
 * @package Migrator
 * @author Sergey M. Litvinov (smart@joomlatune.ru)
 * @copyright (C) 2008-2009 by Sergey M. Litvinov (http://www.joomlatune.ru)
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 */

class JComments_Subscriptions_ETL extends ETLPlugin
{
	function getName()
	{
		return "JComments Subscriptions ETL Plugin";
	}
	
	function getAssociatedTable()
	{
		return 'jcomments_subscriptions';
	}
	
	function mapvalues( $key, $value )
	{
		switch ($key) {
			default:
				return $value;
				break;
		}
	}

	function getSQLPrologue()
	{
		$ret = <<<EOT

CREATE TABLE IF NOT EXISTS `#__jcomments_subscriptions` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`object_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`object_group` VARCHAR(255) NOT NULL DEFAULT '',
`lang` VARCHAR(255) NOT NULL DEFAULT '',
`userid` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`name`VARCHAR(255) NOT NULL DEFAULT '',
`email` VARCHAR(255) NOT NULL DEFAULT '',
`hash` VARCHAR(255) NOT NULL DEFAULT '',
`published` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_object` (`object_id`, `object_group`),
KEY `idx_lang` (`lang`),
KEY `idx_hash` (`hash`)
) TYPE=MyISAM CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
    
EOT;
        return $ret;
    }
}
?>