CREATE TABLE `device_tokens` ( `id` bigint(20) NOT NULL, `user_id` int(10) NOT NULL DEFAULT 0, `from_api` tinyint(1) NOT NULL DEFAULT 0, `token` text DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `device_tokens` ADD PRIMARY KEY (`id`);

ALTER TABLE `device_tokens` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;


CREATE TABLE `video_advertises` (
  `id` bigint(20) NOT NULL,
  `type` tinyint(1) NOT NULL DEFAULT 0,
  `content` text DEFAULT NULL,
  `server` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


ALTER TABLE `video_advertises`
  ADD PRIMARY KEY (`id`);


ALTER TABLE `video_advertises`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;


ALTER TABLE `advertises` DROP `title`;

ALTER TABLE `advertises` DROP `click`;

ALTER TABLE `advertises` ADD `device` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '1=>web, 2=>app' AFTER `id`, ADD `ads_show` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '1=>popup,2=>section' AFTER `device`, ADD `ads_type` VARCHAR(40) NULL DEFAULT NULL AFTER `ads_show`;

ALTER TABLE `general_settings` ADD `pn` TINYINT(1) NOT NULL DEFAULT '0' AFTER `system_info`, ADD `skip_time` INT(11) NOT NULL DEFAULT '0' AFTER `pn`, ADD `tmdb_api` VARCHAR(255) NULL DEFAULT NULL AFTER `skip_time`, ADD `push_config` TEXT NULL DEFAULT NULL AFTER `tmdb_api`;


ALTER TABLE `admin_password_resets` DROP `updated_at`;


INSERT INTO `gateways` (`id`, `form_id`, `code`, `name`, `alias`, `status`, `gateway_parameters`, `supported_currencies`, `crypto`, `extra`, `description`, `created_at`, `updated_at`) VALUES (NULL, '0', '120', 'Authorize.net', 'Authorize', '1', '{\"login_id\":{\"title\":\"Login ID\",\"global\":true,\"value\":\"3Vee5S2F\"},\"transaction_key\":{\"title\":\"Transaction Key\",\"global\":true,\"value\":\"3Vee5S2F\"}}', '{\"USD\":\"USD\",\"CAD\":\"CAD\",\"CHF\":\"CHF\",\"DKK\":\"DKK\",\"EUR\":\"EUR\",\"GBP\":\"GBP\",\"NOK\":\"NOK\",\"PLN\":\"PLN\",\"SEK\":\"SEK\",\"AUD\":\"AUD\",\"NZD\":\"NZD\"}', '0', NULL, NULL, NULL, '2021-07-17 15:44:29');

INSERT INTO `gateways` (`id`, `form_id`, `code`, `name`, `alias`, `status`, `gateway_parameters`, `supported_currencies`, `crypto`, `extra`, `description`, `created_at`, `updated_at`) VALUES (NULL, '0', '121', 'NMI', 'NMI', '1', '{\"api_key\":{\"title\":\"API Key\",\"global\":true,\"value\":\"-------\"}}', '{\"AED\":\"AED\",\"ARS\":\"ARS\",\"AUD\":\"AUD\",\"BOB\":\"BOB\",\"BRL\":\"BRL\",\"CAD\":\"CAD\",\"CHF\":\"CHF\",\"CLP\":\"CLP\",\"CNY\":\"CNY\",\"COP\":\"COP\",\"DKK\":\"DKK\",\"EUR\":\"EUR\",\"GBP\":\"GBP\",\"HKD\":\"HKD\",\"IDR\":\"IDR\",\"ILS\":\"ILS\",\"INR\":\"INR\",\"JPY\":\"JPY\",\"KRW\":\"KRW\",\"MXN\":\"MXN\",\"MYR\":\"MYR\",\"NOK\":\"NOK\",\"NZD\":\"NZD\",\"PEN\":\"PEN\",\"PHP\":\"PHP\",\"PLN\":\"PLN\",\"PYG\":\"PYG\",\"RUB\":\"RUB\",\"SEC\":\"SEC\",\"SGD\":\"SGD\",\"THB\":\"THB\",\"TRY\":\"TRY\",\"TWD\":\"TWD\",\"USD\":\"USD\",\"ZAR\":\"ZAR\"}', '0', NULL, NULL, NULL, '2022-08-28 16:12:37');

ALTER TABLE `extensions` DROP `deleted_at`;
ALTER TABLE `languages` DROP `text_align`;
ALTER TABLE `languages` DROP `icon`;

ALTER TABLE `users` CHANGE `reg_step` `profile_complete` TINYINT(1) NOT NULL DEFAULT '0';

ALTER TABLE `admin_notifications` CHANGE `read_status` `is_read` TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE `admin_password_resets` CHANGE `status` `status` TINYINT(0) NOT NULL DEFAULT '1';


ALTER TABLE `videos` ADD `ads_time` TEXT NULL DEFAULT NULL AFTER `server`, ADD `seconds` TEXT NULL DEFAULT NULL AFTER `ads_time`;

DROP TABLE ` pagespp `;

ALTER TABLE `videos` CHANGE `episode_id` `episode_id` INT(10) NULL DEFAULT '0';