--
-- iCagenda: Install Database `icagenda payment`
--

-- --------------------------------------------------------

--
-- Table structure for table `#__icagenda_payment_orders`
--

CREATE TABLE IF NOT EXISTS `#__icagenda_payment_orders` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `registration_id` int unsigned NOT NULL,
  `user_id` int unsigned NOT NULL DEFAULT 0,
  `order_amount_total` float NOT NULL,
  `order_currency` varchar(10) NOT NULL DEFAULT '',
  `order_processor` varchar(255) NOT NULL,
  `order_ref` varchar(255) NOT NULL,
  `order_state` text NOT NULL,
  `order_transaction_id` varchar(255) NOT NULL,
  `published` tinyint(3) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_registration_id` (`registration_id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_published` (`published`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;


--
-- Table structure for table `#__icagenda_payment_tickets`
--

CREATE TABLE IF NOT EXISTS `#__icagenda_payment_tickets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `order_id` int unsigned NOT NULL,
  `ticket_id` int unsigned NOT NULL,
  `ticket_price` float NOT NULL,
  `ticket_quantity` int(10) NOT NULL,
  `ticket_currency` varchar(10) NOT NULL DEFAULT '',
  `published` tinyint(3) NOT NULL DEFAULT '1',
  `created` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_order_id` (`order_id`),
  KEY `idx_ticket_id` (`ticket_id`),
  KEY `idx_published` (`published`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
