ALTER TABLE `#__djc2_items` DROP `tangible`;
ALTER TABLE `#__djc2_items` ADD `product_type` ENUM('tangible','virtual','subscription') NOT NULL DEFAULT 'tangible' AFTER `weight_unit`;

ALTER TABLE `#__djc2_items` 
ADD `expiration` INT NOT NULL DEFAULT '0' AFTER `product_type`, 
ADD `grant_usergroup` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `expiration`;

CREATE TABLE IF NOT EXISTS `#__djc2_subscriptions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `order_id` int(11) NOT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '1',
  `start_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `expire_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `extended` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `extend_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `granted_usergroup` int(10) UNSIGNED NOT NULL,
  `modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `modified_by` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`,`status`),
  KEY `idx_status` (`status`),
  KEY `idx_usergroup` (`granted_usergroup`),
  KEY `idx_expire` (`expire_date`)
) DEFAULT CHARSET=utf8;