CREATE TABLE IF NOT EXISTS `#__jegroupbuy_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `published` tinyint(4) NOT NULL,
  `description` longtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `#__jegroupbuy_comments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `comments` longtext NOT NULL,
  `cdate` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_payment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `p_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `method` varchar(100) NOT NULL,
  `transaction_id` varchar(100) NOT NULL,
  `pdate` varchar(30) NOT NULL,
  `status` char(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `#__jegroupbuy_product` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(250) NOT NULL,
  `alias` varchar(255) NOT NULL,
  `catid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL,
  `description` longtext NOT NULL,
  `published` tinyint(3) NOT NULL,
  `featured` tinyint(3) NOT NULL,
  `access` tinyint(3) NOT NULL,
  `language` char(7) NOT NULL,
  `imageurl` varchar(250) NOT NULL,
  `product_price` varchar(100) NOT NULL,
  `product_discount` varchar(100) NOT NULL,
  `coupon_code` varchar(50) NOT NULL,
  `you_save` varchar(100) NOT NULL,
  `deal_price` varchar(100) NOT NULL,
  `deal_to_date` varchar(25) NOT NULL,
  `total_bought` int(11) NOT NULL,
  `ordering` int(11) NOT NULL,
  `expired` char(2) NOT NULL,
  `gmap_width` int(5) NOT NULL,
  `gmap_height` int(5) NOT NULL,
  `gmap_latitude` varchar(250) NOT NULL,
  `gmap_longitude` varchar(250) NOT NULL,
  `gmap_zoom` int(4) NOT NULL,
  `params` text NOT NULL,
  `currencysymbol` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_settings` (
  `id` int(11) NOT NULL,
  `show_subscription` char(2) NOT NULL,
  `show_share` char(2) NOT NULL,
  `show_googlemap` char(2) NOT NULL,
  `show_comments` char(2) NOT NULL,
  `layout` varchar(25) NOT NULL,
  `show_footer` tinyint(3) NOT NULL,
  `apikey` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_stores` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `shop_name` varchar(250) NOT NULL,
  `store_id` int(11) NOT NULL,
  `owner` varchar(100) NOT NULL,
  `contact_number` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `shop_url` varchar(200) NOT NULL,
  `published` tinyint(3) NOT NULL,
  `address` longtext NOT NULL,
  `store_logo` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_template` (
  `id` int(11) NOT NULL,
  `template` longtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;