-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `laravel_smmv2`
--

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

--
-- Table structure for table `activities`
--

CREATE TABLE `activities` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_agent` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ip` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `api_mappings`
--

CREATE TABLE `api_mappings` (
  `id` int(10) UNSIGNED NOT NULL,
  `package_id` int(10) UNSIGNED NOT NULL,
  `api_package_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `api_request_headers`
--

CREATE TABLE `api_request_headers` (
  `id` int(10) UNSIGNED NOT NULL,
  `header_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `header_value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `header_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `api_request_headers`
--

INSERT INTO `api_request_headers` (`id`, `header_key`, `header_value`, `header_type`, `api_type`, `api_id`, `created_at`, `updated_at`) VALUES
(1, 'asd', 'asd', 'custom', 'order', 1, '2022-01-09 03:45:33', '2022-01-09 03:45:33'),
(2, 'asd', 'asd', 'custom', 'status', 1, '2022-01-09 03:45:33', '2022-01-09 03:45:33');

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

--
-- Table structure for table `api_request_params`
--

CREATE TABLE `api_request_params` (
  `id` int(10) UNSIGNED NOT NULL,
  `param_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `param_value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `param_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `api_request_params`
--

INSERT INTO `api_request_params` (`id`, `param_key`, `param_value`, `param_type`, `api_type`, `api_id`, `created_at`, `updated_at`) VALUES
(1, 'asd', 'target', 'table_column', 'order', 1, '2022-01-09 03:45:33', '2022-01-09 03:45:33'),
(2, 'asd', 'id', 'table_column', 'status', 1, '2022-01-09 03:45:33', '2022-01-09 03:45:33');

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

--
-- Table structure for table `api_response_logs`
--

CREATE TABLE `api_response_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `order_id` int(10) UNSIGNED NOT NULL,
  `api_id` int(10) UNSIGNED NOT NULL,
  `response` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `balance_histories`
--

CREATE TABLE `balance_histories` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  `action` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `desc` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `configs`
--

CREATE TABLE `configs` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `configs`
--

INSERT INTO `configs` (`id`, `name`, `value`, `created_at`, `updated_at`) VALUES
(1, 'WEB_LOGO_URL', 'http://localhost/img/logo/laravelsmmv2.png', NULL, NULL),
(2, 'WEB_LOGO_URL_DARK', 'http://localhost/img/logo/laravelsmmv2-dark.png', NULL, NULL),
(3, 'WEB_FAVICON_URL', 'http://localhost/img/logo/fav.png', NULL, NULL),
(4, 'APP_NAME', 'Laravel-SMMV2', NULL, NULL),
(5, 'WEB_TITLE', 'Laravel-SMMV2', NULL, NULL),
(6, 'WEB_DESCRIPTION', 'SMM Panel Termurah dan berkualitas tinggi yang menjual jasa layanan Instagram followers,like,view sampai Layanan Youtube seperti subscriber, views, likes. Bergabunglah bersama kami dan tingkatkan penghasilan anda', NULL, NULL),
(7, 'CURRENCY_CODE', 'Rp', NULL, NULL),
(8, 'ADD_MEMBER_PRICE', '5000', NULL, NULL),
(9, 'ADD_AGEN_PRICE', '10000', NULL, NULL),
(10, 'ADD_RESELLER_PRICE', '50000', NULL, NULL),
(11, 'ADD_ADMIN_PRICE', '50000', NULL, NULL),
(12, 'MEMBER_BALANCE', '5000', NULL, NULL),
(13, 'AGEN_BALANCE', '10000', NULL, NULL),
(14, 'RESELLER_BALANCE', '50000', NULL, NULL),
(15, 'ADMIN_BALANCE', '50000', NULL, NULL),
(16, 'MIN_VOUCHER', '5000', NULL, NULL),
(17, 'MAX_VOUCHER', '1000000', NULL, NULL),
(18, 'MIN_DEPOSIT', '5000', NULL, NULL),
(19, 'WEB_AUTH_DESCRIPTION', '<h5 class=\'font-14 text-muted mb-4\'>Laravel-SMMV2, Website Penyedia Jasa Sosial Media &amp; Pulsa PPOB Terbaik</h5>                <p class=\'text-muted mb-4\'>Dengan bergabung bersama kami, Anda dapat menjadi penyedia jasa social media atau reseller social media seperti jasa penambah Followers, Likes, dll.                Saat ini tersedia berbagai layanan untuk social media terpopuler seperti Instagram, Facebook, Twitter, Youtube, dll. Dan kamipun juga menyediakan Panel Pulsa &amp; PPOB seperti Pulsa All Operator, Paket Data, Saldo Gojek/Grab, All Voucher Game Online, Dll.</p>                <h5 class=\'font-14 text-muted mb-4\'>Kelebihan Laravel-SMMV2 :</h5>                <div>                    <p><i class=\'mdi mdi-arrow-right text-primary mr-2\'></i>Harga Instagram Followers mulai dari Rp 100 per 1000</p>                    <p><i class=\'mdi mdi-arrow-right text-primary mr-2\'></i>Harga Instagram Likes mulai dari Rp 0.</p>                    <p><i class=\'mdi mdi-arrow-right text-primary mr-2\'></i>Harga Youtube Subscriber mulai dari Rp 10.000 per 1k subscriber</p>                </div>', NULL, NULL);

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

--
-- Table structure for table `custom_prices`
--

CREATE TABLE `custom_prices` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `service_id` int(10) UNSIGNED NOT NULL,
  `potongan` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `deposits`
--

CREATE TABLE `deposits` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `quantity` int(11) NOT NULL,
  `sender` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `get_balance` int(11) NOT NULL,
  `method` int(10) UNSIGNED NOT NULL,
  `status` enum('Pending','Success','Error','Canceled') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `deposit_methods`
--

CREATE TABLE `deposit_methods` (
  `id` int(10) UNSIGNED NOT NULL,
  `type` enum('MANUAL','AUTO') COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` float NOT NULL,
  `data` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `note` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('Active','Not Active') COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `invitation_codes`
--

CREATE TABLE `invitation_codes` (
  `id` int(10) UNSIGNED NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remains` int(11) NOT NULL,
  `status` enum('Redeemed','Open') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(13, '2019_01_15_040819_create_table_providers', 2),
(18, '2014_10_12_100000_create_password_resets_table', 3),
(19, '2019_01_14_040819_create_table_providers', 3),
(20, '2019_01_14_040914_create_table_services_cats', 3),
(21, '2019_01_15_040834_create_table_services', 3),
(22, '2019_01_15_040853_create_table_services_pulsa', 4),
(23, '2019_02_15_040451_balance_history', 4),
(24, '2019_02_15_040628_create_table_deposits', 4),
(25, '2019_02_15_040710_create_table_news', 4),
(26, '2019_02_15_040726_create_table_orders', 4),
(27, '2019_02_15_040738_create_table_orders_pulsa', 5),
(28, '2019_02_15_040937_create_table_tickets', 5),
(29, '2019_02_21_191101_create_deposit_method', 6),
(30, '2019_02_21_191833_update_deposit_method', 7),
(31, '2019_03_07_055443_activities', 8),
(32, '2019_03_08_023248_create_oprator_table', 9),
(33, '2019_03_13_085721_create_invitation_code', 10),
(34, '2019_03_15_035559_modify_oprator', 11),
(35, '2019_03_15_063031_update_methods', 12),
(36, '2019_03_18_125033_create_staff', 13),
(37, '2019_03_19_054825_create_vouchers', 14),
(38, '2019_04_02_035546_create_ticket_content', 15),
(39, '2019_05_06_013314_custom_price', 16),
(40, '2019_05_30_184739_create_table_configs', 17),
(41, '2019_06_01_030725_add_additional_to_provider', 18),
(42, '2017_05_23_023325_create_apis_table', 19),
(43, '2017_05_23_125309_create_api_mappings_table', 19),
(44, '2017_05_24_110239_create_api_response_logs_table', 19),
(45, '2017_05_25_111202_create_api_request_params_table', 19),
(46, '2019_06_11_152149_combine_providers_api_table', 20),
(47, '2019_06_13_093642_create_table_api_request_header', 21),
(48, '2019_06_15_121529_create_table_sms', 22);

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

--
-- Table structure for table `news`
--

CREATE TABLE `news` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('Service','Info','Maintenance','Update') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(10) UNSIGNED NOT NULL,
  `poid` bigint(20) NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `service_id` int(10) UNSIGNED NOT NULL,
  `target` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `start_count` int(11) NOT NULL,
  `remains` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` int(11) NOT NULL,
  `status` enum('Success','Pending','Processing','Error','Partial') COLLATE utf8mb4_unicode_ci NOT NULL,
  `place_from` enum('WEB','API') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `refund` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `orders_pulsas`
--

CREATE TABLE `orders_pulsas` (
  `id` int(10) UNSIGNED NOT NULL,
  `oid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `poid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `service_id` int(10) UNSIGNED NOT NULL,
  `price` int(11) NOT NULL,
  `data` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sn` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('Success','Error','Pending') COLLATE utf8mb4_unicode_ci NOT NULL,
  `place_from` enum('WEB','API') COLLATE utf8mb4_unicode_ci NOT NULL,
  `refund` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `providers`
--

CREATE TABLE `providers` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('PULSA','SOSMED') COLLATE utf8mb4_unicode_ci NOT NULL,
  `order_type` enum('API','MANUAL','DB') COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `providers`
--

INSERT INTO `providers` (`id`, `name`, `type`, `order_type`, `api_id`, `created_at`, `updated_at`) VALUES
(1, 'test', 'SOSMED', 'API', 1, '2022-01-09 03:45:33', '2022-01-09 03:45:33');

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

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_id` int(10) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `min` int(11) NOT NULL,
  `max` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `price_oper` int(11) NOT NULL,
  `keuntungan` int(11) NOT NULL,
  `type` enum('Basic','Custom Comment','Comment Likes') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('Active','Not Active') COLLATE utf8mb4_unicode_ci NOT NULL,
  `pid` int(11) NOT NULL,
  `provider_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `services`
--

INSERT INTO `services` (`id`, `name`, `category_id`, `note`, `min`, `max`, `price`, `price_oper`, `keuntungan`, `type`, `status`, `pid`, `provider_id`, `created_at`, `updated_at`) VALUES
(1, 'Test Layanan', 1, 'asdasd', 1, 111, 11, 111, 111, 'Basic', 'Active', 111, 1, '2022-01-09 03:45:51', '2022-01-09 03:45:51');

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

--
-- Table structure for table `services_pulsas`
--

CREATE TABLE `services_pulsas` (
  `id` int(10) UNSIGNED NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `oprator_id` int(10) UNSIGNED NOT NULL,
  `category_id` int(10) UNSIGNED NOT NULL,
  `price` int(11) NOT NULL,
  `keuntungan` int(11) DEFAULT NULL,
  `status` enum('Active','Not Active') COLLATE utf8mb4_unicode_ci NOT NULL,
  `provider_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `services_pulsa_operators`
--

CREATE TABLE `services_pulsa_operators` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `category_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `service_cats`
--

CREATE TABLE `service_cats` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` enum('SOSMED','PULSA') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('Active','Not Active') COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `service_cats`
--

INSERT INTO `service_cats` (`id`, `name`, `type`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Test Kategori', 'SOSMED', 'Active', '2022-01-09 03:43:55', '2022-01-09 03:43:55');

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

--
-- Table structure for table `sms_message`
--

CREATE TABLE `sms_message` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `from` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `staff`
--

CREATE TABLE `staff` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `facebook_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `facebook_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `picture` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tickets`
--

CREATE TABLE `tickets` (
  `id` int(10) UNSIGNED NOT NULL,
  `subject` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `status` enum('Open','Responded','Closed','User reply') COLLATE utf8mb4_unicode_ci NOT NULL,
  `read_by_admin` tinyint(1) NOT NULL DEFAULT '0',
  `read_by_user` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ticket_contents`
--

CREATE TABLE `ticket_contents` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `ticket_id` int(10) UNSIGNED NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vouchers`
--

CREATE TABLE `vouchers` (
  `id` int(10) UNSIGNED NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('Available','Used') COLLATE utf8mb4_unicode_ci NOT NULL,
  `quantity` double(8,2) NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activities`
--
ALTER TABLE `activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `activities_user_id_foreign` (`user_id`);

--
-- Indexes for table `api_mappings`
--
ALTER TABLE `api_mappings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `api_mappings_api_id_foreign` (`api_id`);

--
-- Indexes for table `api_request_headers`
--
ALTER TABLE `api_request_headers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `api_request_headers_api_id_foreign` (`api_id`);

--
-- Indexes for table `api_request_params`
--
ALTER TABLE `api_request_params`
  ADD PRIMARY KEY (`id`),
  ADD KEY `api_request_params_api_id_foreign` (`api_id`);

--
-- Indexes for table `api_response_logs`
--
ALTER TABLE `api_response_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asdasd` (`api_id`);

--
-- Indexes for table `balance_histories`
--
ALTER TABLE `balance_histories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `balance_histories_user_id_foreign` (`user_id`);

--
-- Indexes for table `configs`
--
ALTER TABLE `configs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `custom_prices`
--
ALTER TABLE `custom_prices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `custom_prices_user_id_foreign` (`user_id`),
  ADD KEY `custom_prices_service_id_foreign` (`service_id`);

--
-- Indexes for table `deposits`
--
ALTER TABLE `deposits`
  ADD PRIMARY KEY (`id`),
  ADD KEY `deposits_user_id_foreign` (`user_id`),
  ADD KEY `method` (`method`);

--
-- Indexes for table `deposit_methods`
--
ALTER TABLE `deposit_methods`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `invitation_codes`
--
ALTER TABLE `invitation_codes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `news`
--
ALTER TABLE `news`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `orders_user_id_foreign` (`user_id`),
  ADD KEY `orders_service_id_foreign` (`service_id`);

--
-- Indexes for table `orders_pulsas`
--
ALTER TABLE `orders_pulsas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `orders_pulsa_user_id_foreign` (`user_id`),
  ADD KEY `orders_pulsa_service_id_foreign` (`service_id`);

--
-- Indexes for table `providers`
--
ALTER TABLE `providers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `api_id` (`api_id`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `services_category_id_foreign` (`category_id`),
  ADD KEY `services_provider_id_foreign` (`provider_id`);

--
-- Indexes for table `services_pulsas`
--
ALTER TABLE `services_pulsas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `services_pulsas_provider_id_foreign` (`provider_id`),
  ADD KEY `oprator_id` (`oprator_id`),
  ADD KEY `services_pulsas_category_id_foreign` (`category_id`);

--
-- Indexes for table `services_pulsa_operators`
--
ALTER TABLE `services_pulsa_operators`
  ADD PRIMARY KEY (`id`),
  ADD KEY `services_pulsa_operators_category_id_foreign` (`category_id`);

--
-- Indexes for table `service_cats`
--
ALTER TABLE `service_cats`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sms_message`
--
ALTER TABLE `sms_message`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `staff`
--
ALTER TABLE `staff`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tickets`
--
ALTER TABLE `tickets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tickets_user_id_foreign` (`user_id`);

--
-- Indexes for table `ticket_contents`
--
ALTER TABLE `ticket_contents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ticket_contents_user_id_foreign` (`user_id`),
  ADD KEY `ticket_contents_ticket_id_foreign` (`ticket_id`);

--
-- Indexes for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `vouchers_user_id_foreign` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `activities`
--
ALTER TABLE `activities`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `api_mappings`
--
ALTER TABLE `api_mappings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `api_request_headers`
--
ALTER TABLE `api_request_headers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `api_request_params`
--
ALTER TABLE `api_request_params`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `api_response_logs`
--
ALTER TABLE `api_response_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `balance_histories`
--
ALTER TABLE `balance_histories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `configs`
--
ALTER TABLE `configs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `custom_prices`
--
ALTER TABLE `custom_prices`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `deposits`
--
ALTER TABLE `deposits`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `deposit_methods`
--
ALTER TABLE `deposit_methods`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `invitation_codes`
--
ALTER TABLE `invitation_codes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `news`
--
ALTER TABLE `news`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders_pulsas`
--
ALTER TABLE `orders_pulsas`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `providers`
--
ALTER TABLE `providers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `services_pulsas`
--
ALTER TABLE `services_pulsas`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `services_pulsa_operators`
--
ALTER TABLE `services_pulsa_operators`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `service_cats`
--
ALTER TABLE `service_cats`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sms_message`
--
ALTER TABLE `sms_message`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff`
--
ALTER TABLE `staff`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `tickets`
--
ALTER TABLE `tickets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ticket_contents`
--
ALTER TABLE `ticket_contents`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `vouchers`
--
ALTER TABLE `vouchers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `activities`
--
ALTER TABLE `activities`
  ADD CONSTRAINT `activities_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `api_mappings`
--
ALTER TABLE `api_mappings`
  ADD CONSTRAINT `api_mappings_api_id_foreign` FOREIGN KEY (`api_id`) REFERENCES `apis` (`id`);

--
-- Constraints for table `api_request_headers`
--
ALTER TABLE `api_request_headers`
  ADD CONSTRAINT `api_request_headers_api_id_foreign` FOREIGN KEY (`api_id`) REFERENCES `apis` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `api_request_params`
--
ALTER TABLE `api_request_params`
  ADD CONSTRAINT `api_request_params_api_id_foreign` FOREIGN KEY (`api_id`) REFERENCES `apis` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `balance_histories`
--
ALTER TABLE `balance_histories`
  ADD CONSTRAINT `balance_histories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `custom_prices`
--
ALTER TABLE `custom_prices`
  ADD CONSTRAINT `custom_prices_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `custom_prices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `deposits`
--
ALTER TABLE `deposits`
  ADD CONSTRAINT `deposits_ibfk_1` FOREIGN KEY (`method`) REFERENCES `deposit_methods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `deposits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `orders_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `orders_pulsas`
--
ALTER TABLE `orders_pulsas`
  ADD CONSTRAINT `orders_pulsa_service_id_foreign` FOREIGN KEY (`service_id`) REFERENCES `services_pulsas` (`id`),
  ADD CONSTRAINT `orders_pulsa_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `providers`
--
ALTER TABLE `providers`
  ADD CONSTRAINT `providers_ibfk_1` FOREIGN KEY (`api_id`) REFERENCES `apis` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `services`
--
ALTER TABLE `services`
  ADD CONSTRAINT `services_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `service_cats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_provider_id_foreign` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `services_pulsas`
--
ALTER TABLE `services_pulsas`
  ADD CONSTRAINT `services_pulsas_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `service_cats` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_pulsas_ibfk_1` FOREIGN KEY (`oprator_id`) REFERENCES `services_pulsa_operators` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `services_pulsas_provider_id_foreign` FOREIGN KEY (`provider_id`) REFERENCES `providers` (`id`);

--
-- Constraints for table `services_pulsa_operators`
--
ALTER TABLE `services_pulsa_operators`
  ADD CONSTRAINT `services_pulsa_operators_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `service_cats` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tickets`
--
ALTER TABLE `tickets`
  ADD CONSTRAINT `tickets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ticket_contents`
--
ALTER TABLE `ticket_contents`
  ADD CONSTRAINT `ticket_contents_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ticket_contents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `vouchers`
--
ALTER TABLE `vouchers`
  ADD CONSTRAINT `vouchers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

