--
-- Table structure for table `#__vikrestaurants_upsell_item_pairs`
--

CREATE TABLE IF NOT EXISTS `#__vikrestaurants_upsell_item_pairs` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `item_a` int(10) NOT NULL,
  `item_b` int(10) NOT NULL,
  `count` int(10) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

--
-- Table structure for table `#__vikrestaurants_upsell_item_totals`
--

CREATE TABLE IF NOT EXISTS `#__vikrestaurants_upsell_item_totals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `item` int(10) NOT NULL,
  `count` int(10) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

--
-- Table structure for table `#__vikrestaurants_section_product_attr_assoc`
--

CREATE TABLE IF NOT EXISTS `#__vikrestaurants_section_product_attr_assoc` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id_menuentry` int(10) unsigned NOT NULL,
  `id_attribute` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

--
-- Table structure for table `#__vikrestaurants_table`
--

ALTER TABLE `#__vikrestaurants_table`
ADD COLUMN `ordering` int(10) DEFAULT 1;

-- make sure we have a valid ordering
UPDATE `#__vikrestaurants_table`
SET `ordering` = `id`;

--
-- Table structure for table `#__vikrestaurants_specialdays`
--

ALTER TABLE `#__vikrestaurants_specialdays`
MODIFY `name` varchar(64) NOT NULL,
ADD COLUMN `booknotes` text DEFAULT NULL COMMENT 'notes displayed during the booking process',
ADD COLUMN `confnotes` text DEFAULT NULL COMMENT 'notes displayed after completing the booking process';

--
-- Table structure for table `#__vikrestaurants_gpayments`
--

ALTER TABLE `#__vikrestaurants_gpayments`
ADD COLUMN `service` varchar(32) DEFAULT NULL AFTER `group`;

--
-- Table structure for table `#__vikrestaurants_custfields`
--

ALTER TABLE `#__vikrestaurants_custfields`
ADD COLUMN `specialdays` varchar(256) DEFAULT NULL COMMENT 'a JSON list containing all the configured special days (IDs)' AFTER `locale`;

--
-- Table structure for table `#__vikrestaurants_takeaway_menus_entry`
--

ALTER TABLE `#__vikrestaurants_takeaway_menus_entry`
ADD COLUMN `minqty` int(4) DEFAULT 1 AFTER `published`;

--
-- Table structure for table `#__vikrestaurants_takeaway_res_prod_assoc`
--

ALTER TABLE `#__vikrestaurants_takeaway_res_prod_assoc`
ADD COLUMN `tags` varchar(128) DEFAULT NULL;

--
-- Table structure for table `#__vikrestaurants_takeaway_menus_attribute`
--

ALTER TABLE `#__vikrestaurants_takeaway_menus_attribute`
ADD COLUMN `icontype` varchar(16) DEFAULT 'image' COMMENT 'either image or fonticon' AFTER `published`,
ADD COLUMN `font` varchar(256) DEFAULT NULL COMMENT 'the font icon JSON config' AFTER `icon`;

--
-- Dump table `#__vikrestaurants_config`
--

INSERT INTO `#__vikrestaurants_config`
(                   `param`, `setting`) VALUES
(               'resperint',         0),
(             'guestperint',         0),
(         'bill_items_auto',      '[]'),
(         'enableupselling',         0),
(          'upselling_topn',         6),
('upselling_training_since',        ''),
(       'upselling_weights',      '{}');
