CREATE TABLE `tblcp_events_tracking` (
  `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `tenant_id` BIGINT(20) UNSIGNED NOT NULL,
  `staff_id` BIGINT(20) UNSIGNED NOT NULL,
  `event_code_name` VARCHAR(200) COLLATE utf8_unicode_ci DEFAULT NULL,
  `event_data` LONGTEXT DEFAULT NULL,
  `mobile_type` ENUM('android','ios','web') NOT NULL,
  `device_info` TEXT DEFAULT NULL,
  `added_on` DATETIME NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `staff_id` (`staff_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE INDEX event_code_name ON tblcp_events_tracking (event_code_name);
CREATE INDEX mobile_type ON tblcp_events_tracking (mobile_type);

CREATE TABLE `tbltenant_order_from_lowes` (
  `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `tenant_id` BIGINT(20) UNSIGNED NOT NULL,
  `staff_id` BIGINT(20) UNSIGNED NOT NULL,
  `order_no` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL,
  `order_currency` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `order_amount` decimal(15,2) DEFAULT 0.00,
  `order_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `order_date` DATETIME NOT NULL,
  `postback_json` LONGTEXT DEFAULT NULL,
  `added_on` DATETIME NOT NULL,
  `modified_on` DATETIME NOT NULL,
  PRIMARY KEY (`id`),
  KEY `tenant_id` (`tenant_id`),
  KEY `staff_id` (`staff_id`),
  KEY `order_no` (`order_no`)
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
