CREATE TABLE IF NOT EXISTS `affiliate_earnings` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `referrer_id` bigint NOT NULL,
  `referee_id` bigint NOT NULL,
  `transaction_id` bigint NOT NULL,
  `commission_percent` bigint NOT NULL,
  `commission_value` bigint NOT NULL DEFAULT '0',
  `paid` tinyint(1) NOT NULL DEFAULT '0',
  `amount` float NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `referrer_id` (`referrer_id`) USING BTREE,
  KEY `referee_id` (`referee_id`) USING BTREE,
  KEY `transaction_id` (`transaction_id`) USING BTREE,
  KEY `paid` (`paid`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `cache` (
  `key` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `value` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `cache_locks` (
  `key` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `owner` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `cashouts` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `earning_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_id` bigint NOT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `method` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `payout_batch_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `details` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

CREATE TABLE IF NOT EXISTS `categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `icon` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `parent` int DEFAULT NULL,
  `range` int DEFAULT '1',
  `for` tinyint(1) DEFAULT '1' COMMENT '0 for posts / 1 for products',
  `featured` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`,`parent`,`slug`,`for`),
  KEY `range` (`range`),
  KEY `for` (`for`),
  KEY `parent` (`parent`),
  KEY `slug` (`slug`),
  KEY `featured` (`featured`),
  FULLTEXT KEY `description` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `comments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `product_id` int NOT NULL,
  `body` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent` int DEFAULT NULL,
  `approved` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  `read_by_admin` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `updated_at` (`updated_at`),
  KEY `product_id` (`product_id`),
  KEY `approved` (`approved`),
  KEY `parent` (`parent`),
  KEY `read_by_admin` (`read_by_admin`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `coupons` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `value` float NOT NULL,
  `is_percentage` tinyint(1) DEFAULT '0',
  `users_ids` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `starts_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `used_by` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  `products_ids` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `subscriptions_ids` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `once` tinyint(1) DEFAULT '0',
  `for` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'products',
  `regular_license_only` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `value` (`value`),
  KEY `starts_at` (`starts_at`),
  KEY `expires_at` (`expires_at`),
  KEY `updated_at` (`updated_at`),
  KEY `deleted_at` (`deleted_at`),
  KEY `once` (`once`) USING BTREE,
  KEY `for` (`for`) USING BTREE,
  KEY `regular_license_only` (`regular_license_only`) USING BTREE,
  FULLTEXT KEY `users_ids` (`users_ids`),
  FULLTEXT KEY `used_by` (`used_by`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `custom_routes` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `view` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `method` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'get',
  `csrf_protection` tinyint(1) DEFAULT '0',
  `views` bigint DEFAULT '0',
  `active` tinyint(1) DEFAULT '1',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `method` (`method`),
  KEY `updated_at` (`updated_at`),
  KEY `created_at` (`created_at`),
  KEY `slug` (`slug`),
  KEY `active` (`active`),
  KEY `views` (`views`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `faqs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `question` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `answer` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `active` tinyint(1) DEFAULT '1',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `updated_at` (`updated_at`),
  KEY `active` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `key_s` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `code` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `user_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `product_id` bigint DEFAULT NULL,
  `purchased_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE,
  KEY `purchased_at` (`purchased_at`) USING BTREE,
  KEY `product_id` (`product_id`) USING BTREE,
  KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `licenses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `regular` int DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE,
  KEY `deleted_at` (`deleted_at`) USING BTREE,
  KEY `regular` (`regular`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `newsletter_subscribers` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deletet_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `email` (`email`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `notifications` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` int NOT NULL,
  `users_ids` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `for` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `deleted_at` (`deleted_at`),
  KEY `product_id` (`product_id`),
  KEY `for` (`for`),
  FULLTEXT KEY `users_ids` (`users_ids`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `pages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `short_description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `tags` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `views` int DEFAULT '0',
  `deletable` tinyint(1) DEFAULT '1',
  `active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `slug` (`slug`),
  KEY `updated_at` (`updated_at`),
  KEY `active` (`active`),
  KEY `views` (`views`),
  KEY `deletable` (`deletable`),
  FULLTEXT KEY `description` (`name`,`slug`,`short_description`,`content`,`tags`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `password_resets` (
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `payment_links` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '0',
  `processor` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_id` bigint NOT NULL,
  `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `token` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `short_link` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `reference` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  `amount` float DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `short_link` (`short_link`) USING BTREE,
  KEY `name` (`name`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE,
  KEY `deleted_at` (`deleted_at`) USING BTREE,
  KEY `user_id` (`user_id`) USING BTREE,
  KEY `processor` (`processor`) USING BTREE,
  KEY `reference` (`reference`) USING BTREE,
  KEY `amount` (`amount`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `posts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `short_description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `cover` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `tags` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `active` tinyint(1) DEFAULT '1',
  `views` int DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  `category` int NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`id`,`name`,`slug`),
  KEY `updated_at` (`updated_at`),
  KEY `active` (`active`),
  KEY `views` (`views`),
  KEY `slug` (`slug`),
  KEY `category` (`category`),
  FULLTEXT KEY `search` (`name`,`short_description`,`content`,`tags`),
  FULLTEXT KEY `tags` (`tags`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `prepaid_credits` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `specs` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `popular` tinyint(1) DEFAULT '0',
  `order` tinyint DEFAULT '0',
  `discount` float DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `popular` (`popular`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `amount` (`amount`),
  KEY `order` (`order`),
  KEY `discount` (`discount`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `pricing_table` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `products` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `categories` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `price` float DEFAULT '0',
  `description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `specifications` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `days` int DEFAULT '0',
  `limit_downloads` int DEFAULT '0',
  `color` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `limit_downloads_per_day` int DEFAULT '0',
  `limit_downloads_same_item` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT '0',
  `position` int DEFAULT '0',
  `popular` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `slug` (`slug`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `limit_downloads_per_day` (`limit_downloads_per_day`) USING BTREE,
  KEY `limit_downloads` (`limit_downloads`) USING BTREE,
  KEY `price` (`price`) USING BTREE,
  KEY `days` (`days`) USING BTREE,
  KEY `position` (`position`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `slug` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `short_description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `overview` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `notes` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `active` tinyint(1) DEFAULT '1',
  `category` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `subcategories` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `cover` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `screenshots` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `version` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `release_date` date DEFAULT NULL,
  `last_update` date DEFAULT NULL,
  `included_files` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `tags` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `software` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `db` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `compatible_browsers` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `compatible_os` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `high_resolution` tinyint(1) DEFAULT '0',
  `documentation` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `file_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `preview` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `file_size` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `file_host` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'local',
  `file_extension` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `free` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `featured` tinyint(1) DEFAULT '0',
  `trending` tinyint(1) DEFAULT '0',
  `views` int DEFAULT '0',
  `faq` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `promotional_price_time` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `stock` int DEFAULT NULL,
  `hidden_content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `enable_license` tinyint(1) DEFAULT NULL,
  `direct_download_link` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `newest` tinyint(1) DEFAULT '0',
  `for_subscriptions` tinyint(1) DEFAULT '0',
  `bpm` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `bit_rate` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `table_of_contents` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `pages` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `words` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `language` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `formats` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `authors` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `preview_url` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `additional_fields` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `country_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `preview_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `preview_extension` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `minimum_price` float DEFAULT NULL,
  `fake_sales` bigint DEFAULT NULL,
  `fake_comments` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `fake_reviews` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `affiliate_link` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `permalink` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `tmp_direct_link` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permalink` (`permalink`),
  KEY `category` (`category`),
  KEY `subcategories` (`subcategories`),
  KEY `documentation` (`documentation`),
  KEY `release_date` (`release_date`),
  KEY `created_at` (`created_at`),
  KEY `deleted_at` (`deleted_at`),
  KEY `updated_at` (`updated_at`),
  KEY `active` (`active`),
  KEY `file_name` (`file_name`),
  KEY `file_host` (`file_host`),
  KEY `featured` (`featured`),
  KEY `trending` (`trending`),
  KEY `free` (`free`),
  KEY `promotional_price_time` (`promotional_price_time`) USING BTREE,
  KEY `stock` (`stock`) USING BTREE,
  KEY `enable_license` (`enable_license`) USING BTREE,
  KEY `views` (`views`) USING BTREE,
  KEY `for_subscriptions` (`for_subscriptions`) USING BTREE,
  KEY `pages` (`pages`) USING BTREE,
  KEY `words` (`words`) USING BTREE,
  KEY `language` (`language`) USING BTREE,
  KEY `formats` (`formats`) USING BTREE,
  KEY `authors` (`authors`) USING BTREE,
  KEY `bpm` (`bpm`) USING BTREE,
  KEY `bit_rate` (`bit_rate`) USING BTREE,
  KEY `country_city` (`country_city`) USING BTREE,
  KEY `newest` (`newest`) USING BTREE,
  KEY `minimum_price` (`minimum_price`),
  KEY `fake_sales` (`fake_sales`),
  FULLTEXT KEY `name_slug_short_description` (`name`,`slug`,`short_description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `product_price` (
  `product_id` int NOT NULL,
  `license_id` int NOT NULL,
  `price` float DEFAULT '0',
  `promo_price` float DEFAULT NULL,
  UNIQUE KEY `product_id_license_id` (`product_id`,`license_id`) USING BTREE,
  KEY `price` (`price`) USING BTREE,
  KEY `promo_price` (`promo_price`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `reactions` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `item_id` int NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `user_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `deleted_at` (`deleted_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE,
  KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `reviews` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `product_id` int NOT NULL,
  `rating` float DEFAULT '0',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `approved` tinyint(1) DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  `read_by_admin` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_product` (`user_id`,`product_id`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `deleted_at` (`deleted_at`),
  KEY `product_id` (`product_id`),
  KEY `approved` (`approved`),
  KEY `read_by_admin` (`read_by_admin`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `searches` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_id` bigint DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `created_at` (`created_at`) USING BTREE,
  KEY `updated_at` (`updated_at`) USING BTREE,
  KEY `user_id` (`user_id`) USING BTREE,
  KEY `keywords` (`keywords`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `sessions` (
  `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `payload` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `settings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `general` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `mailer` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `payments` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `search_engines` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `adverts` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `files_host` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `social_login` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `chat` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `captcha` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `database` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `affiliate` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `maintenance` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `statistics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `traffic` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `browsers` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `devices` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `oss` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `subscription_same_item_downloads` (
  `subscription_id` bigint NOT NULL,
  `product_id` bigint NOT NULL,
  `downloads` bigint NOT NULL,
  UNIQUE KEY `sub_unique` (`subscription_id`,`product_id`) USING BTREE,
  KEY `subscription_id` (`subscription_id`) USING BTREE,
  KEY `product_id` (`product_id`) USING BTREE,
  KEY `downloads` (`downloads`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `support` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email_id` int NOT NULL,
  `subject` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `message` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `read` tinyint(1) DEFAULT '0',
  `parent` tinyint DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `read_by_admin` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `email_id` (`email_id`),
  KEY `updated_at` (`updated_at`),
  KEY `read` (`read`),
  KEY `parent` (`parent`),
  KEY `read_by_admin` (`read_by_admin`) USING BTREE,
  FULLTEXT KEY `search` (`subject`,`message`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `support_email` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `temp_direct_urls` (
  `product_id` bigint DEFAULT NULL,
  `host` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `url` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `expiry` int DEFAULT NULL,
  UNIQUE KEY `product_id` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `processor` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `products_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `licenses_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `coupon_id` int DEFAULT NULL,
  `reference_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `order_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `transaction_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `amount` float NOT NULL,
  `discount` float DEFAULT NULL,
  `refunded` tinyint(1) DEFAULT '0',
  `refund` float DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `items_count` int NOT NULL,
  `is_subscription` tinyint(1) DEFAULT '0',
  `guest_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `guest_email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'paid',
  `confirmed` tinyint(1) DEFAULT '1',
  `exchange_rate` float DEFAULT NULL,
  `details` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `licenses` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `custom_amount` float DEFAULT NULL,
  `payment_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `read_by_admin` tinyint(1) DEFAULT '0',
  `referrer_id` bigint DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `sandbox` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `processor_transaction_id` (`processor`,`transaction_id`) USING BTREE,
  KEY `products_ids` (`products_ids`),
  KEY `coupon_id` (`coupon_id`),
  KEY `refunded` (`refunded`),
  KEY `refund` (`refund`),
  KEY `processor` (`processor`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `deleted_at` (`deleted_at`),
  KEY `amount` (`amount`),
  KEY `user_id` (`user_id`),
  KEY `search` (`processor`,`order_id`,`transaction_id`,`amount`,`reference_id`),
  KEY `items_count` (`items_count`),
  KEY `is_subscription` (`is_subscription`),
  KEY `guest_token` (`guest_token`) USING BTREE,
  KEY `status` (`status`) USING BTREE,
  KEY `exchange_rate` (`exchange_rate`) USING BTREE,
  KEY `confirmed` (`confirmed`) USING BTREE,
  KEY `reference_id` (`reference_id`) USING BTREE,
  KEY `licenses_ids` (`licenses_ids`) USING BTREE,
  KEY `payment_url` (`payment_url`) USING BTREE,
  KEY `custom_amount` (`custom_amount`) USING BTREE,
  KEY `read_by_admin` (`read_by_admin`) USING BTREE,
  KEY `referrer_id` (`referrer_id`) USING BTREE,
  KEY `sandbox` (`sandbox`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `transaction_note` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `transaction_id` bigint DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transaction_id` (`transaction_id`),
  KEY `user_id` (`user_id`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `affiliate_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `email_verified_at` date DEFAULT NULL,
  `firstname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `lastname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `role` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'user',
  `remember_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `provider_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `provider` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `id_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `blocked` tinyint(1) DEFAULT '0',
  `receive_notifs` tinyint(1) DEFAULT '1',
  `cashout_method` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `paypal_account` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `bank_account` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `prepaid_credits` float DEFAULT NULL,
  `affiliate_credits` float DEFAULT NULL,
  `credits_sources` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `user` (`name`,`email`),
  KEY `name` (`name`),
  KEY `updated_at` (`updated_at`),
  KEY `verified` (`email_verified_at`),
  KEY `role` (`role`),
  KEY `created_at` (`created_at`),
  KEY `blocked` (`blocked`) USING BTREE,
  KEY `receive_notifs` (`receive_notifs`) USING BTREE,
  KEY `affiliate_name` (`affiliate_name`) USING BTREE,
  KEY `cashout_method` (`cashout_method`) USING BTREE,
  KEY `paypal_account` (`paypal_account`) USING BTREE,
  KEY `credits` (`prepaid_credits`) USING BTREE,
  KEY `affiliate_credits` (`affiliate_credits`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `user_prepaid_credits` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `prepaid_credits_id` bigint NOT NULL,
  `transaction_id` bigint NOT NULL,
  `user_id` bigint NOT NULL,
  `credits` float NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `transaction_id` (`transaction_id`),
  KEY `prepaid_credits_id` (`prepaid_credits_id`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `user_subscription` (
  `id` int NOT NULL AUTO_INCREMENT,
  `subscription_id` int NOT NULL,
  `user_id` int DEFAULT NULL,
  `starts_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `ends_at` datetime DEFAULT NULL,
  `downloads` int DEFAULT '0',
  `transaction_id` bigint DEFAULT '0',
  `daily_downloads` int DEFAULT '0',
  `daily_downloads_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `subscription_id` (`subscription_id`),
  KEY `user_id` (`user_id`),
  KEY `starts_at` (`starts_at`),
  KEY `downloads` (`downloads`),
  KEY `transaction_id` (`transaction_id`) USING BTREE,
  KEY `daily_downloads` (`daily_downloads`) USING BTREE,
  KEY `daily_downloads_date` (`daily_downloads_date`) USING BTREE,
  KEY `ends_at` (`ends_at`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT IGNORE INTO `settings` (`id`, `general`, `mailer`, `payments`, `search_engines`, `adverts`, `files_host`, `social_login`, `chat`, `captcha`, `database`, `affiliate`, `maintenance`, `created_at`, `updated_at`, `deleted_at`) VALUES
  (1, '{"name":"Valexa","title":"Valexa - PHP Script For Selling Digital Products","description":"Valexa, a single vendor php script for selling digital products, software, graphics, audios, videos, fonts, icons, templates and any downloadable items.","email":"exmaple@gmail.com","keywords":"digital downloads php script, shopping cart php script, ecommerce php script, paypal php script, stripe php script, digital store php script, gpl store php script, gpl licence php script, paypal digital download","items_per_page":"12","favicon":"favicon.svg","logo":"tendra_logo.svg","search_cover":"search_cover.png","env":"production","debug":"0","timezone":"Europe/London","tiktok":"#","facebook":"#","twitter":"#","pinterest":"#","youtube":"#","tumblr":"#","search_header":"Templates, PHP Scripts, Graphics and Codes starting from $2","search_subheader":null,"cover":"cover.png","blog":{"enabled":"1","title":"Valexa - PHP Script For Selling Digital Products","description":"Valexa, a single vendor php script for selling digital products, software, graphics, audios, videos, fonts, icons, templates and any downloadable items.","disqus":"0"},"blog_cover":"blog_cover.jpg","fb_app_id":null,"langs":"en,ar,fr","template":"axies","fonts":{"ltr":"@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-Regular.ttf\');\\r\\n  font-weight: 400;\\r\\n  font-style: normal;\\r\\n}\\r\\n\\r\\n@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-Medium.ttf\');\\r\\n  font-weight: 500;\\r\\n  font-style: normal;\\r\\n}\\r\\n\\r\\n@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-SemiBold.ttf\');\\r\\n  font-weight: 600;\\r\\n  font-style: normal;\\r\\n}\\r\\n\\r\\n@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-Bold.ttf\');\\r\\n  font-weight: 700;\\r\\n  font-style: normal;\\r\\n}\\r\\n\\r\\n@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-ExtraBold.ttf\');\\r\\n  font-weight: 800;\\r\\n  font-style: normal;\\r\\n}\\r\\n\\r\\n@font-face {\\r\\n  font-family: \'Spartan\';\\r\\n  src: url(\'/assets/fonts/Spartan/Spartan-Black.ttf\');\\r\\n  font-weight: 900;\\r\\n  font-style: normal;\\r\\n}","rtl":"https://fonts.googleapis.com/css2?family=Almarai:wght@400;700&display=swap"},"subscriptions":"{\\"enabled\\":\\"1\\",\\"accumulative\\":\\"1\\"}","watermark":null,"users_notif":"Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio, nisi maiores praesentium delectus animi.","tendra_top_cover":"tendra_top_cover.webp","purchase_code":null,"tendra_top_cover_mask":null,"email_verification":"1","auto_approve":"{\\"support\\":\\"1\\",\\"reviews\\":\\"1\\"}","admin_notifications":"{\\"comments\\":\\"1\\",\\"reviews\\":\\"1\\",\\"sales\\":\\"1\\"}","products_by_country_city":"0","recently_viewed_items":"1","cookie_text":"<p>We use cookies to understand how you use our website and to improve your experience. This includes personalizing content and advertising. To learn more, please click <a href=\\"https://tendra.codemayer.tech/page/privacy-policy\\" target=\\"_blank\\"><b style=\\"color: rgb(49, 24, 115);\\">Here</b></a>. By continuing to use our website, you accept our use of cookies, Privacy policy and terms &amp; conditions.<br></p>","cookie":"{\\"text\\":\\"<p>We use cookies to understand how you use our website and to improve your experience. This includes personalizing content and advertising. To learn more, please click Here. By continuing to use our website, you accept our use of cookies, Privacy policy and terms &amp; conditions.<br><\\\\/p>\\",\\"background\\":\\"#9550a5\\",\\"color\\":\\"#ffffff\\",\\"button_bg\\":\\"#e8e8e8\\"}","masonry_layout":null,"randomize_homepage_items":"0","direct_download_links":null,"pricing_cover":null,"template_color":"dark","html_editor":"tinymce_bbcode","can_delete_own_comments":"1","show_rating":"product_page,product_card","show_sales":"product_page","registration_fields":"name,email,password,password_confirmation","required_registration_fields":"email,password,password_confirmation","show_streaming_player":"1","enable_comments":"1","enable_reviews":"1","enable_reactions_on_comments":"1","enable_subcomments":"1","realtime_views":"{\\"website\\":{\\"enabled\\":\\"1\\",\\"fake\\":\\"1\\",\\"range\\":\\"15,30\\"},\\"product\\":{\\"enabled\\":\\"1\\",\\"fake\\":\\"1\\",\\"range\\":\\"50,60\\"},\\"refresh\\":\\"30\\"}","counters":"products,categories,online_users,affiliate_earnings,orders","fake_profiles":[],"fake_purchases":"{\\"enabled\\":\\"0\\",\\"pages\\":\\"product,home,products,checkout\\",\\"interval\\":\\"60,120\\"}","prepaid_credits":"{\\"enabled\\":\\"1\\",\\"expires_in\\":null}","js_css_code":"{\\"frontend\\":null,\\"backend\\":null}","permalink_url_identifer":"p","invoice":"{\\"template\\":\\"2\\",\\"tos\\":\\"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Deleniti eaque omnis quod, rerum magnam, corrupti, modi veritatis necessitatibus commodi, minus sunt? Error porro velit qui, commodi expedita, consectetur? Illum, ex.\\"}","fullwide":"0","enable_upload_links":"0","enable_blade_cache":"1","enable_data_cache":"0","categories_on_homepage":"0","fake_counters":"1","color_cursor":"0","authorized_bots":"google, yandex, yahoo, bing, baidu, facebook, reddit","user_views_per_minute":"120","axies_top_cover":null,"force_download":"1","allow_download_in_test_mode":"0","available_via_subscriptions_only_message":"This item is available via subscriptions only","authentication_required_to_download_free_items":"0","generate_download_links_for_missing_files":"1","show_add_to_cart_button_on_the_product_card":"1","show_badges_on_the_product_card":"1","product_card_cover_mask":"card-mask-2.webp"}', '{"mail":{"username":"example@gmail.com","password":null,"host":null,"port":"465","encryption":"tls","reply_to":null,"forward_to":"","use_queue":"0","from":{"name":"Valexa","address":"example@gmail.com"}}}', '{"gateways":{"sslcommerz":{"name":"sslcommerz","icon":"/assets/images/payment/sslcommerz_icon.png","description":"Credit / Debit Cards, Mobile Banking, Internet Banking, E-Wallets, Easy Monthly Installments","order":"2","mode":"sandbox","store_id":null,"store_passwd":null,"use_ipn":"1","fee":null,"minimum":null,"auto_exchange_to":null},"stripe":{"name":"stripe","icon":"/assets/images/payment/stripe_icon.png","description":"Card, Ideal, Giropay, FPX, EPS, Alipay, P24, Bancontact","order":"3","mode":"sandbox","client_id":null,"secret_id":null,"methods":"card","fee":null,"minimum":null,"auto_exchange_to":null},"spankpay":{"name":"spankpay","icon":"/assets/images/payment/spankpay_icon.png","description":"BTC, ETH, LTC, USDC","order":"4","public_key":null,"secret_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"skrill":{"name":"skrill","icon":"/assets/images/payment/skrill_icon.png","description":"iDEAL, Maestro, Neteller, Skrill Digital Wallet, Credit or Debit Card","order":"5","mode":"sandbox","merchant_account":null,"mqiapi_secret_word":null,"mqiapi_password":null,"methods":"ACC","fee":null,"minimum":null,"auto_exchange_to":null},"razorpay":{"name":"razorpay","icon":"/assets/images/payment/razorpay_icon.png","description":"Debit or Credit Card, Netbanking, Bank Transfer, EMI, UPI","order":"6","client_id":null,"secret_id":null,"webhook_secret":null,"fee":null,"minimum":null,"auto_exchange_to":null},"paystack":{"name":"paystack","icon":"/assets/images/payment/paystack_icon.png","description":"Cards, Mobile money, QR codes, Bank transfer, USSD","order":"7","public_key":null,"secret_key":null,"channels":"ussd,bank,card,bank_transfer,qr,mobile_money","fee":null,"minimum":null,"auto_exchange_to":null},"paypal":{"name":"paypal","icon":"/assets/images/payment/paypal_icon.png","description":"PayPal balance, Bank account, PayPal Credit, Debit/Credit cards, Rewards balance","order":"8","mode":"sandbox","client_id":null,"secret_id":null,"fee":null,"minimum":null,"auto_exchange_to":null},"paymentwall":{"name":"paymentwall","icon":"/assets/images/payment/paymentwall_icon.png","description":"Visa, MasterCard, American Express, Discover, Diners Club, Genie, Frimi, eZcash, mCash, Sampath Vishwa","order":"9","mode":"sandbox","project_key":null,"secret_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"payhere":{"name":"payhere","icon":"/assets/images/payment/payhere_icon.png","description":"Visa, MasterCard, American Express, Discover, Diners Club, Genie, Frimi, eZcash, mCash, Sampath Vishwa","order":"10","mode":"sandbox","merchant_secret":null,"merchant_id":null,"fee":null,"minimum":null,"auto_exchange_to":null},"omise":{"name":"omise","icon":"/assets/images/payment/omise_icon.png","description":"Credit/Debit card, Installment payments, Internet Banking, PromptPay, TrueMoney Wallet, Rabbit Line Pay, PayNow, OCBC Pay Anyone, Alipay, WeChat Pay, Bill payment, Pay-easy, FPX","order":"11","mode":"sandbox","public_key":null,"secret_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"midtrans":{"name":"midtrans","icon":"/assets/images/payment/midtrans_icon.png","description":"Credit / Debit card, Danamon online, CIMB clicks, BCA klikpay, Mandiri, Alfamart, Permata va ...","order":"12","mode":"sandbox","client_key":null,"server_key":null,"merchant_id":null,"methods":"credit_card,danamon_online,bca_klikpay,mandiri_clickpay,bri_epay,bca_klikbca","fee":null,"minimum":null,"auto_exchange_to":null},"iyzico":{"name":"iyzico","icon":"/assets/images/payment/iyzico_icon.png","description":"MasterCard, MasterCard Debit, American Express, Visa Electron, Visa Debit ...","order":"13","mode":"sandbox","client_id":null,"secret_id":null,"fee":null,"minimum":null,"auto_exchange_to":null},"instamojo":{"name":"instamojo","icon":"/assets/images/payment/instamojo_icon.png","description":"Bank transfer, Debit/ Credit Cards, Netbanking, Wallets, UPI, EMI","order":"14","mode":"sandbox","private_salt":null,"client_id":null,"secret_id":null,"fee":null,"minimum":null,"auto_exchange_to":null},"flutterwave":{"name":"flutterwave","icon":"/assets/images/payment/flutterwave_icon.png","description":"Credit/Debit card, Bank transfer, Mobile money, M-Pesa, QR payment, USSD, Barter","order":"15","mode":"sandbox","public_key":null,"secret_key":null,"encryption_key":null,"secret_hash":null,"methods":"banktransfer,mpesa,mobilemoneyrwanda,card,ussd,credit,account,barter,qr,mobilemoneyuganda","fee":null,"minimum":null,"auto_exchange_to":null},"coingate":{"name":"coingate","icon":"/assets/images/payment/coingate_icon.png","description":"BTC, ETH, USDT, LTC","order":"16","mode":"sandbox","auth_token":null,"receive_currency":null,"fee":null,"minimum":null,"auto_exchange_to":null},"authorizenet":{"name":"authorizenet","icon":"/assets/images/payment/authorizenet_icon.png","description":"Debit cards, Credit cards, Apple Pay, PayPal ...","order":"17","mode":"sandbox","api_login_id":null,"client_key":null,"transaction_key":null,"signature_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"adyen":{"name":"adyen","icon":"/assets/images/payment/adyen_icon.png","description":"Klarna, iDEAL, Oney, Amazon Pay, Alipay, Visa, American Express (AMEX), Cartes Bancaires, Diners, ...","order":"18","mode":"sandbox","api_key":null,"client_key":null,"merchant_account":null,"hmac_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"youcanpay":{"name":"youcanpay","icon":"/assets/images/payment/youcanpay_icon.ico","description":"Debit or Credit Cards","order":"19","mode":"sandbox","public_key":null,"private_key":null,"fee":null,"minimum":null,"auto_exchange_to":null},"credits":{"name":"credits","icon":"/assets/images/payment/credits_icon.png","description":"Pay with your available credits.","order":"20","fee":"5","minimum":null,"auto_exchange_to":null},"offlinepayment":{"name":"offlinepayment","icon":"/assets/images/payment/offlinepayment_icon.png","description":"Bank transfer, Cash, Check, ACH credit transfer, SEPA credit transfer","order":"21","instructions":null,"fee":null,"minimum":null,"auto_exchange_to":null}},"tos":"1","tos_url":"/page/terms-and-conditions","vat":"20","buyer_note":"1","currency_code":"USD","currency_symbol":"$","currency_position":"left","exchange_rate":1,"currencies":"eur,usd,inr,idr,gbp,btc,try,ngn,USD","allow_foreign_currencies":"1","exchanger":"api_coingate_com","currencyscoop_api_key":null,"exchangeratesapi_io_key":null,"coinmarketcap_api_key":null,"guest_checkout":"0","pay_what_you_want":{"enabled":"0","for":"products,subscriptions"},"currency_by_country":"0","enable_add_to_cart":"1","show_prices_in_k_format":"0","delete_pending_orders":"500","exchangers":{"pro_api_coinmarketcap_com":{"api_key":null},"api_exchangeratesapi_io":{"api_key":null},"api_currencyscoop_com":{"api_key":null},"api_exchangerate_host":{"api_key":null},"api_coingate_com":{"api_key":null}}, "enable_webhooks":null}', '{"robots":"follow, index","json_ld":"0","site_verification":null,"analytics_code":null,"indexnow_key":null}', '{"responsive_ad":null,"auto_ad":null,"ad_728x90":null,"ad_468x60":null,"ad_300x250":null,"ad_320x100":null,"popup_ad":null}', '{"google_drive":{"folder_id":null,"api_key":null,"client_id":null,"secret_id":null,"chunk_size":"4","refresh_token":null,"connected_email":null,"id_token":null},"google_cloud_storage":{"project_id":null,"private_key_id":null,"private_key":null,"client_email":null,"client_id":null,"auth_provider_x509_cert_url":"https:\\/\\/www.googleapis.com\\/oauth2\\/v1\\/certs","client_x509_cert_url":"https:\\/\\/www.googleapis.com\\/robot\\/v1\\/metadata\\/x509\\/codemayer-g-cloud-storage%40optical-empire-373721.iam.gserviceaccount.com","bucket":null},"dropbox":{"folder_path":null,"app_key":null,"app_secret":null,"access_token":null,"current_account":null},"yandex":{"folder_path":null,"client_id":null,"secret_id":null,"refresh_token":null},"amazon_s3":{"access_key_id":null,"secret_key":null,"bucket":null,"region":"us-west-2","version":"latest"},"wasabi":{"access_key":null,"secret_key":null,"bucket":null,"region":"eu-central-1","version":"latest"},"remote_files":{"headers":null,"body":null}}', '{"google":{"client_id":null,"secret_id":null,"redirect":null},"github":{"client_id":null,"secret_id":null,"redirect":null},"linkedin":{"client_id":null,"secret_id":null,"redirect":null},"facebook":{"client_id":null,"secret_id":null,"redirect":null},"vkontakte":{"client_id":null,"secret_id":null,"redirect":null},"twitter":{"client_id":null,"secret_id":null,"redirect":null},"dribbble":{"client_id":null,"secret_id":null,"redirect":null}}', '{"code":null}', '{"enable_on":null,"google":{"secret":null,"sitekey":null,"attributes":{"data-theme":"light","data-size":"normal"},"options":{"timeout":"30"}},"mewebstudio":{"length":"4","math":false,"width":"150","height":"40","quality":"90"}}', '{"host":"127.0.0.1","database":null,"username":null,"password":null,"charset":"utf8","collation":"utf8_unicode_ci","port":"3306","sort_buffer_size":"5","sql_mode":"STRICT_TRANS_TABLES","timezone":"+00:00"}', '{"enabled":"0","commission":"10","expire":"30","cashout_methods":"paypal_account,bank_account","minimum_cashout":{"paypal":"50","bank_transfer":"250"},"cashout_description":"<p>All earnings will be transferred to your account based on the selected method, whether via PayPal or Bank transfer.<\\/p><ul><li>The minimum amount to&nbsp;<span style=\\"font-size: 1.14286rem;\\">cash out via<\\/span><span style=\\"font-size: 1.14286rem;\\">&nbsp;PayPal&nbsp; : USD 50.00<\\/span><\\/li><li>The minimum amount to&nbsp;<span style=\\"font-size: 1.14286rem;\\">cash out via<\\/span><span style=\\"font-size: 1.14286rem;\\">&nbsp;bank transfer : USD 250.00<\\/span><\\/li><\\/ul><p><span style=\\"font-size: 1.14286rem;\\">Earnings are paid automatically be the end of each month, as long as, your balance has the minimum amount.<\\/span><\\/p><p><span style=\\"font-size: 1.14286rem;\\">Your earnings, in case of an&nbsp;<\\/span><span style=\\"font-size: 16px;\\">insufficiency, will be reported to the next month.<\\/span><\\/p>"}', '{"enabled":"0","exception":"127.0.0.1","expires_at":null,"auto_disable":"1","title":null,"header":null,"subheader":null,"text":null,"bg_color":"#000000"}', '2020-01-17 16:06:00', '2023-02-02 11:37:29', NULL);

INSERT IGNORE INTO `licenses` (`name`, `regular`) VALUES ('Regular licenses', '1'), ('Extended license', '0');