CREATE TABLE IF NOT EXISTS `#__vikrentitems_condtexts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(128) DEFAULT NULL,
  `token` varchar(64) DEFAULT NULL,
  `rules` text DEFAULT NULL,
  `msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `lastupd` datetime DEFAULT NULL,
  `debug` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `#__vikrentitems_orderhistory` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idorder` int(10) NOT NULL,
  `dt` datetime NOT NULL,
  `type` char(2) NOT NULL DEFAULT 'C',
  `descr` text DEFAULT NULL,
  `totpaid` decimal(12,2) DEFAULT NULL,
  `total` decimal(12,2) DEFAULT NULL,
  `data` varchar(1024) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

ALTER TABLE `#__vikrentitems_wpshortcodes` CHANGE `lang` `lang` varchar(16);
ALTER TABLE `#__vikrentitems_orders` CHANGE `lang` `lang` varchar(16);
ALTER TABLE `#__vikrentitems_wpshortcodes` ADD COLUMN `parent_id` int(10) unsigned DEFAULT 0;
ALTER TABLE `#__vikrentitems_seasons` CHANGE `iditems` `iditems` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_restrictions` CHANGE `iditems` `iditems` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_timeslots` CHANGE `iditems` `iditems` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_coupons` CHANGE `iditems` `iditems` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_discountsquants` CHANGE `iditems` `iditems` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_optionals` CHANGE `specifications` `specifications` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_optionals` ADD COLUMN `maxdays` int(10) NOT NULL DEFAULT 0 AFTER `forceifdays`;
ALTER TABLE `#__vikrentitems_gpayments` CHANGE `params` `params` varchar(1024) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_places` ADD COLUMN `combomap` varchar(1024) DEFAULT NULL AFTER `wopening`;
ALTER TABLE `#__vikrentitems_condtexts` CHANGE `msg` `msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL;
ALTER TABLE `#__vikrentitems_coupons` ADD COLUMN `maxtotord` decimal(12,2) DEFAULT NULL;
ALTER TABLE `#__vikrentitems_coupons` ADD COLUMN `excludetaxes` tinyint(1) NOT NULL DEFAULT 1;