· 5 years ago · Feb 26, 2020, 05:28 PM
1-- Adminer 4.3.1 MySQL dump
2
3SET NAMES utf8;
4SET time_zone = '+00:00';
5SET foreign_key_checks = 0;
6SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
7
8SET NAMES utf8mb4;
9
10DROP TABLE IF EXISTS `ads`;
11CREATE TABLE `ads` (
12 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
13 `state` tinyint(4) NOT NULL,
14 `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
15 `image` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
16 `hyperlink` varchar(310) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
17 `date_start` datetime NOT NULL,
18 `date_end` datetime NOT NULL,
19 `target` varchar(8192) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
20 `created_at` timestamp NULL DEFAULT NULL,
21 `updated_at` timestamp NULL DEFAULT NULL,
22 `deleted_at` timestamp NULL DEFAULT NULL,
23 PRIMARY KEY (`id`)
24) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
26
27DROP TABLE IF EXISTS `analytics`;
28CREATE TABLE `analytics` (
29 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
30 `user_id` int(10) unsigned NOT NULL,
31 `action_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
32 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
33 `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
34 `created_at` timestamp NULL DEFAULT NULL,
35 `updated_at` timestamp NULL DEFAULT NULL,
36 PRIMARY KEY (`id`),
37 KEY `analytics_user_id_foreign` (`user_id`),
38 CONSTRAINT `analytics_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
39) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
40
41
42DROP TABLE IF EXISTS `avatars`;
43CREATE TABLE `avatars` (
44 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
45 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
46 `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
47 `role` int(11) DEFAULT NULL,
48 `required_published_reports` int(11) NOT NULL,
49 `icon_male` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
50 `icon_female` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
51 `active` tinyint(1) NOT NULL,
52 `created_at` timestamp NULL DEFAULT NULL,
53 `updated_at` timestamp NULL DEFAULT NULL,
54 `deleted_at` timestamp NULL DEFAULT NULL,
55 PRIMARY KEY (`id`)
56) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
57
58
59DROP TABLE IF EXISTS `campaigns`;
60CREATE TABLE `campaigns` (
61 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
62 `active` tinyint(1) NOT NULL,
63 `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
64 `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
65 `thumbnail_url` text COLLATE utf8mb4_unicode_ci,
66 `type` text COLLATE utf8mb4_unicode_ci NOT NULL,
67 `start_date` datetime DEFAULT NULL,
68 `end_date` datetime DEFAULT NULL,
69 `user_id` bigint(20) unsigned NOT NULL,
70 `created_at` timestamp NULL DEFAULT NULL,
71 `updated_at` timestamp NULL DEFAULT NULL,
72 `deleted_at` timestamp NULL DEFAULT NULL,
73 PRIMARY KEY (`id`)
74) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
75
76
77DROP TABLE IF EXISTS `campaign_tag`;
78CREATE TABLE `campaign_tag` (
79 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
80 `campaign_id` bigint(20) unsigned NOT NULL,
81 `tag_id` bigint(20) unsigned NOT NULL,
82 `created_at` timestamp NULL DEFAULT NULL,
83 `updated_at` timestamp NULL DEFAULT NULL,
84 PRIMARY KEY (`id`),
85 KEY `easy2b_campaigns_tags_campaign_id_foreign` (`campaign_id`),
86 KEY `easy2b_campaigns_tags_tag_id_foreign` (`tag_id`),
87 CONSTRAINT `easy2b_campaigns_tags_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
88 CONSTRAINT `easy2b_campaigns_tags_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `easy2b_tags` (`id`) ON DELETE CASCADE
89) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
90
91
92DROP TABLE IF EXISTS `challenges`;
93CREATE TABLE `challenges` (
94 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
95 `state` tinyint(4) NOT NULL,
96 `short_description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
97 `description` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL,
98 `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
99 `date_start` datetime NOT NULL,
100 `date_end` datetime NOT NULL,
101 `reward` int(10) unsigned DEFAULT NULL,
102 `reward_quantity` int(11) NOT NULL,
103 `reward_quantity_remaining` int(11) NOT NULL,
104 `target` varchar(8192) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
105 `required_reports` int(11) DEFAULT NULL,
106 `required_likes` int(11) DEFAULT NULL,
107 `required_invites` int(11) DEFAULT NULL,
108 `required_best_reports` int(11) DEFAULT NULL,
109 `required_points` int(11) DEFAULT NULL,
110 `notification_email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
111 `created_at` timestamp NULL DEFAULT NULL,
112 `updated_at` timestamp NULL DEFAULT NULL,
113 `deleted_at` timestamp NULL DEFAULT NULL,
114 PRIMARY KEY (`id`),
115 KEY `challenges_reward_foreign` (`reward`),
116 CONSTRAINT `challenges_reward_foreign` FOREIGN KEY (`reward`) REFERENCES `challenges_rewards` (`id`) ON DELETE CASCADE
117) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
118
119
120DROP TABLE IF EXISTS `challenges_points_distribution`;
121CREATE TABLE `challenges_points_distribution` (
122 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
123 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
124 `value` int(11) NOT NULL,
125 `created_at` timestamp NULL DEFAULT NULL,
126 `updated_at` timestamp NULL DEFAULT NULL,
127 PRIMARY KEY (`id`)
128) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
129
130
131DROP TABLE IF EXISTS `challenges_rewards`;
132CREATE TABLE `challenges_rewards` (
133 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
134 `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
135 `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
136 `type` tinyint(4) NOT NULL,
137 `created_at` timestamp NULL DEFAULT NULL,
138 `updated_at` timestamp NULL DEFAULT NULL,
139 `deleted_at` timestamp NULL DEFAULT NULL,
140 PRIMARY KEY (`id`)
141) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
142
143
144DROP TABLE IF EXISTS `challenges_winners`;
145CREATE TABLE `challenges_winners` (
146 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
147 `challenge_id` int(10) unsigned NOT NULL,
148 `user_id` int(10) unsigned NOT NULL,
149 `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
150 `created_at` timestamp NULL DEFAULT NULL,
151 `updated_at` timestamp NULL DEFAULT NULL,
152 `deleted_at` timestamp NULL DEFAULT NULL,
153 PRIMARY KEY (`id`),
154 KEY `challenges_winners_challenge_id_foreign` (`challenge_id`),
155 KEY `challenges_winners_user_id_foreign` (`user_id`),
156 CONSTRAINT `challenges_winners_challenge_id_foreign` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE,
157 CONSTRAINT `challenges_winners_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
158) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
159
160
161DROP TABLE IF EXISTS `easy2b_ads`;
162CREATE TABLE `easy2b_ads` (
163 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
164 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
165 `campaign_id` bigint(20) unsigned NOT NULL,
166 `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
167 `title` text COLLATE utf8mb4_unicode_ci,
168 `text` text COLLATE utf8mb4_unicode_ci,
169 `image_url` text COLLATE utf8mb4_unicode_ci,
170 `image_size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
171 `template_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
172 `brand_color` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
173 `url` text COLLATE utf8mb4_unicode_ci,
174 `daily_budget` int(11) DEFAULT NULL,
175 `total_budget` int(11) DEFAULT NULL,
176 `start_date` datetime DEFAULT NULL,
177 `end_date` datetime DEFAULT NULL,
178 `state` smallint(6) NOT NULL DEFAULT '1',
179 `paused` tinyint(1) NOT NULL DEFAULT '0',
180 `evaluated_by` int(10) unsigned DEFAULT NULL,
181 `not_approved_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
182 `user_id` int(10) unsigned NOT NULL,
183 `created_at` timestamp NULL DEFAULT NULL,
184 `updated_at` timestamp NULL DEFAULT NULL,
185 `deleted_at` timestamp NULL DEFAULT NULL,
186 PRIMARY KEY (`id`),
187 KEY `easy2b_ads_campaign_id_index` (`campaign_id`),
188 KEY `easy2b_ads_evaluated_by_index` (`evaluated_by`),
189 KEY `easy2b_ads_user_id_index` (`user_id`),
190 CONSTRAINT `easy2b_ads_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
191 CONSTRAINT `easy2b_ads_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
192 CONSTRAINT `easy2b_ads_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
193) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
194
195
196DROP TABLE IF EXISTS `easy2b_ads_images`;
197CREATE TABLE `easy2b_ads_images` (
198 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
199 `ad_id` bigint(20) unsigned NOT NULL,
200 `campaign_id` bigint(20) unsigned NOT NULL,
201 `content` longtext COLLATE utf8mb4_unicode_ci,
202 `url` text COLLATE utf8mb4_unicode_ci,
203 `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
204 `background_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
205 `logo_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
206 `created_at` timestamp NULL DEFAULT NULL,
207 `updated_at` timestamp NULL DEFAULT NULL,
208 `deleted_at` timestamp NULL DEFAULT NULL,
209 PRIMARY KEY (`id`),
210 KEY `easy2b_ads_images_ad_id_foreign` (`ad_id`),
211 KEY `easy2b_ads_images_campaign_id_foreign` (`campaign_id`),
212 CONSTRAINT `easy2b_ads_images_ad_id_foreign` FOREIGN KEY (`ad_id`) REFERENCES `easy2b_ads` (`id`) ON DELETE CASCADE,
213 CONSTRAINT `easy2b_ads_images_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE
214) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
215
216
217DROP TABLE IF EXISTS `easy2b_campaigns`;
218CREATE TABLE `easy2b_campaigns` (
219 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
220 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
221 `active` tinyint(1) NOT NULL,
222 `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
223 `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
224 `thumbnail_url` text COLLATE utf8mb4_unicode_ci,
225 `image_size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
226 `type` text COLLATE utf8mb4_unicode_ci NOT NULL,
227 `daily_budget` int(11) DEFAULT NULL,
228 `total_budget` int(11) DEFAULT NULL,
229 `start_date` datetime DEFAULT NULL,
230 `end_date` datetime DEFAULT NULL,
231 `state` smallint(6) NOT NULL DEFAULT '1',
232 `paused` tinyint(1) NOT NULL DEFAULT '0',
233 `proposed` tinyint(1) NOT NULL DEFAULT '0',
234 `evaluated_by` int(10) unsigned DEFAULT NULL,
235 `not_approved_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
236 `user_id` int(10) unsigned NOT NULL,
237 `created_at` timestamp NULL DEFAULT NULL,
238 `updated_at` timestamp NULL DEFAULT NULL,
239 `deleted_at` timestamp NULL DEFAULT NULL,
240 PRIMARY KEY (`id`),
241 KEY `easy2b_campaigns_evaluated_by_index` (`evaluated_by`),
242 KEY `easy2b_campaigns_user_id_index` (`user_id`),
243 CONSTRAINT `easy2b_campaigns_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
244 CONSTRAINT `easy2b_campaigns_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
245) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
246
247
248DROP TABLE IF EXISTS `easy2b_discounts`;
249CREATE TABLE `easy2b_discounts` (
250 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
251 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
252 `campaign_id` bigint(20) unsigned NOT NULL,
253 `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
254 `title` text COLLATE utf8mb4_unicode_ci,
255 `text` text COLLATE utf8mb4_unicode_ci,
256 `value` double(8,2) DEFAULT NULL,
257 `image_url` text COLLATE utf8mb4_unicode_ci,
258 `image_size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
259 `url` text COLLATE utf8mb4_unicode_ci,
260 `percentage` int(11) DEFAULT NULL,
261 `code` text COLLATE utf8mb4_unicode_ci,
262 `daily_budget` int(11) DEFAULT NULL,
263 `total_budget` int(11) DEFAULT NULL,
264 `start_date` datetime DEFAULT NULL,
265 `end_date` datetime DEFAULT NULL,
266 `state` smallint(6) NOT NULL DEFAULT '1',
267 `paused` tinyint(1) NOT NULL DEFAULT '0',
268 `evaluated_by` int(10) unsigned DEFAULT NULL,
269 `not_approved_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
270 `user_id` int(10) unsigned NOT NULL,
271 `created_at` timestamp NULL DEFAULT NULL,
272 `updated_at` timestamp NULL DEFAULT NULL,
273 `deleted_at` timestamp NULL DEFAULT NULL,
274 PRIMARY KEY (`id`),
275 KEY `easy2b_discounts_campaign_id_index` (`campaign_id`),
276 KEY `easy2b_discounts_evaluated_by_index` (`evaluated_by`),
277 KEY `easy2b_discounts_user_id_index` (`user_id`),
278 CONSTRAINT `easy2b_discounts_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
279 CONSTRAINT `easy2b_discounts_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
280 CONSTRAINT `easy2b_discounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
281) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
282
283
284DROP TABLE IF EXISTS `easy2b_discounts_images`;
285CREATE TABLE `easy2b_discounts_images` (
286 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
287 `discount_id` bigint(20) unsigned NOT NULL,
288 `campaign_id` bigint(20) unsigned NOT NULL,
289 `content` longtext COLLATE utf8mb4_unicode_ci,
290 `url` text COLLATE utf8mb4_unicode_ci,
291 `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
292 `background_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
293 `logo_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
294 `created_at` timestamp NULL DEFAULT NULL,
295 `updated_at` timestamp NULL DEFAULT NULL,
296 `deleted_at` timestamp NULL DEFAULT NULL,
297 PRIMARY KEY (`id`),
298 KEY `easy2b_discounts_images_discount_id_foreign` (`discount_id`),
299 KEY `easy2b_discounts_images_campaign_id_foreign` (`campaign_id`),
300 CONSTRAINT `easy2b_discounts_images_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
301 CONSTRAINT `easy2b_discounts_images_discount_id_foreign` FOREIGN KEY (`discount_id`) REFERENCES `easy2b_discounts` (`id`) ON DELETE CASCADE
302) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
303
304
305DROP TABLE IF EXISTS `easy2b_log`;
306CREATE TABLE `easy2b_log` (
307 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
308 `type` int(11) NOT NULL,
309 `element_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
310 `element_id` int(11) NOT NULL,
311 `info` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
312 `user_id` int(10) unsigned DEFAULT NULL,
313 `created_at` timestamp NULL DEFAULT NULL,
314 `updated_at` timestamp NULL DEFAULT NULL,
315 PRIMARY KEY (`id`),
316 KEY `easy2b_log_user_id_foreign` (`user_id`),
317 CONSTRAINT `easy2b_log_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
318) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
319
320
321DROP TABLE IF EXISTS `easy2b_notifications`;
322CREATE TABLE `easy2b_notifications` (
323 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
324 `type` int(11) NOT NULL,
325 `state` int(11) NOT NULL DEFAULT '0',
326 `text` text COLLATE utf8mb4_unicode_ci NOT NULL,
327 `url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
328 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
329 `user_id` int(10) unsigned NOT NULL,
330 `created_at` timestamp NULL DEFAULT NULL,
331 `updated_at` timestamp NULL DEFAULT NULL,
332 `deleted_at` timestamp NULL DEFAULT NULL,
333 PRIMARY KEY (`id`),
334 KEY `easy2b_notifications_user_id_index` (`user_id`),
335 CONSTRAINT `easy2b_notifications_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
336) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
337
338
339DROP TABLE IF EXISTS `easy2b_payments`;
340CREATE TABLE `easy2b_payments` (
341 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
342 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
343 `transaction_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
344 `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
345 `status` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
346 `entity` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
347 `reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
348 `url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
349 `IBAN` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
350 `descriptive` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
351 `customer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
352 `campaign_id` bigint(20) unsigned NOT NULL,
353 `value` int(11) NOT NULL,
354 `additional_info` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
355 `evaluated_by` int(10) unsigned DEFAULT NULL,
356 `date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
357 `created_at` timestamp NULL DEFAULT NULL,
358 `updated_at` timestamp NULL DEFAULT NULL,
359 `deleted_at` timestamp NULL DEFAULT NULL,
360 PRIMARY KEY (`id`),
361 UNIQUE KEY `easy2b_payments_identifier_unique` (`identifier`),
362 UNIQUE KEY `easy2b_payments_descriptive_unique` (`descriptive`),
363 KEY `easy2b_payments_campaign_id_foreign` (`campaign_id`),
364 KEY `easy2b_payments_evaluated_by_foreign` (`evaluated_by`),
365 CONSTRAINT `easy2b_payments_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
366 CONSTRAINT `easy2b_payments_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE
367) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
368
369INSERT INTO `easy2b_payments` (`id`, `identifier`, `transaction_id`, `type`, `status`, `entity`, `reference`, `url`, `IBAN`, `descriptive`, `customer_id`, `campaign_id`, `value`, `additional_info`, `evaluated_by`, `date`, `created_at`, `updated_at`, `deleted_at`) VALUES
370(1, 'E2B-T14V-BJXV6', '8a5f46a7-7a7f-4fc7-a4a7-063b035d9873', 'mb', 'pending', '11683', '831002618', NULL, NULL, NULL, '2ec63f0a-b5c2-43b6-8189-bcee61b75079', 209, 42, NULL, NULL, '2019-10-01 16:59:34', '2019-10-01 17:59:34', '2019-10-01 17:59:34', NULL),
371(2, 'E2B-KU0J-N09M2', 'bb20b8df-4d80-472d-9609-fbe3dcf2f525', 'cc', 'pending', NULL, NULL, 'https://cc.test.easypay.pt/start/bb20b8df-4d80-472d-9609-fbe3dcf2f525', NULL, NULL, '89be7a2f-a359-4d41-8345-9c4c66774428', 210, 70, NULL, NULL, '2019-10-01 17:00:13', '2019-10-01 18:00:13', '2019-10-01 18:00:13', NULL),
372(3, 'E2B-QN54-GNTL3', NULL, 'wt', 'paid', 'ENTIDADE', NULL, NULL, NULL, 'MFTTJC', NULL, 211, 70, NULL, NULL, '2019-10-01 17:00:26', '2019-10-01 18:00:26', '2019-10-02 16:08:50', NULL),
373(4, 'E2B-GJJL-DOVX9', NULL, 'wt', 'paid', 'ENTIDADE', NULL, NULL, NULL, 'NPQCUX', NULL, 212, 70, NULL, NULL, '2019-10-02 09:13:56', '2019-10-02 10:13:56', '2019-10-02 16:06:30', NULL),
374(5, 'E2B-VXDC-LJUK8', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'TFM4DG', NULL, 213, 70, NULL, NULL, '2019-10-02 09:22:19', '2019-10-02 10:22:19', '2019-10-02 15:03:59', NULL),
375(6, 'E2B-QRTT-ITK55', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'BAXMSA', NULL, 214, 70, NULL, NULL, '2019-10-02 09:23:32', '2019-10-02 10:23:32', '2019-10-02 15:04:25', NULL),
376(7, 'E2B-4MEA-MMAE7', '11010220-45ca-4bb9-b6cb-58a17c8bb1d6', 'mb', 'pending', '11683', '831002657', NULL, NULL, NULL, '8d3b429a-146a-4bef-bca3-0e7189da6f4b', 215, 70, NULL, NULL, '2019-10-02 09:23:58', '2019-10-02 10:23:58', '2019-10-02 10:23:58', NULL),
377(8, 'E2B-SSNK-POFN6', '262ea950-9cc1-4528-81c0-2200d572ce93', 'mb', 'pending', '11683', '831002705', NULL, NULL, NULL, 'a9f1db0a-ea45-45e4-8c09-517924ef3e9a', 216, 70, NULL, NULL, '2019-10-02 09:24:41', '2019-10-02 10:24:41', '2019-10-02 10:24:41', NULL),
378(9, 'E2B-4KCB-CLB79', 'd03c4a68-67b3-4cbf-9225-cb98bd97fb46', 'cc', 'pending', NULL, NULL, 'https://cc.test.easypay.pt/start/d03c4a68-67b3-4cbf-9225-cb98bd97fb46', NULL, NULL, 'dcaa74f7-c1fd-40cd-8633-4506cffe5252', 217, 70, NULL, NULL, '2019-10-02 10:09:14', '2019-10-02 11:09:14', '2019-10-02 11:09:14', NULL),
379(10, 'E2B-XCXA-JI4O7', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'Y4JZC9', NULL, 219, 70, NULL, NULL, '2019-10-02 14:51:50', '2019-10-02 15:51:50', '2019-10-02 16:06:33', NULL),
380(11, 'E2B-RRAK-IYJI8', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'FGIHNV', NULL, 220, 70, NULL, NULL, '2019-10-02 15:00:13', '2019-10-02 16:00:13', '2019-10-02 16:06:34', NULL),
381(12, 'E2B-XKJU-9XRN0', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'JXBRPX', NULL, 221, 70, NULL, NULL, '2019-10-02 16:22:39', '2019-10-02 17:22:39', '2019-10-04 16:19:40', NULL),
382(13, 'E2B-CBLI-S4ZW3', 'db053632-8de6-4b4c-899d-42e5256d6176', 'cc', 'paid', NULL, NULL, 'https://cc.test.easypay.pt/start/db053632-8de6-4b4c-899d-42e5256d6176', NULL, NULL, 'b8b265ed-9cbb-4296-843b-939f48e12c60', 222, 900, NULL, NULL, '2019-10-02 16:26:12', '2019-10-02 17:26:12', '2019-10-07 11:07:33', NULL),
383(14, 'E2B-VSKT-FDRP5', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'YIIAKH', NULL, 224, 700, NULL, NULL, '2019-10-03 09:23:42', '2019-10-03 10:23:42', '2019-10-03 10:23:42', NULL),
384(15, 'E2B-KDSY-R1RK4', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'BT7H70', NULL, 232, 70, NULL, NULL, '2019-10-04 10:52:02', '2019-10-04 11:52:02', '2019-10-04 11:52:02', NULL),
385(16, 'E2B-GFTZ-4KHH0', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'NDFCGQ', NULL, 233, 70, NULL, NULL, '2019-10-04 10:54:54', '2019-10-04 11:54:54', '2019-10-04 11:54:54', NULL),
386(17, 'E2B-XQVO-5JJV5', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'FWBTAQ', NULL, 234, 9000, NULL, NULL, '2019-10-04 11:10:42', '2019-10-04 12:10:42', '2019-10-04 12:10:42', NULL),
387(18, 'E2B-TPHW-ROS64', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', '9M6TNE', NULL, 235, 7, NULL, NULL, '2019-10-04 15:58:33', '2019-10-04 16:58:33', '2019-10-07 10:34:16', NULL),
388(19, 'E2B-FINQ-DZPP6', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'S0STUY', NULL, 236, 70, NULL, NULL, '2019-10-07 11:25:16', '2019-10-07 12:25:16', '2019-10-07 12:25:16', NULL),
389(20, 'E2B-ZXWS-T5MY3', '85cd71e5-8432-4a6a-b153-c6b5747d591a', 'mb', 'pending', '11683', '831003453', NULL, NULL, NULL, 'd3765585-d148-482d-9842-7bdb9eb91c88', 237, 70, NULL, NULL, '2019-10-07 13:56:34', '2019-10-07 14:56:34', '2019-10-07 14:56:34', NULL),
390(21, 'E2B-AJ8K-1QAR4', '08fbb6d0-b1ef-4cbb-a92f-f88c4f621999', 'mb', 'pending', '11683', '831003501', NULL, NULL, NULL, '0a82bee9-ad0c-48a1-bbf9-64a2ebf56d77', 238, 70, NULL, NULL, '2019-10-07 13:57:51', '2019-10-07 14:57:51', '2019-10-07 14:57:51', NULL),
391(22, 'E2B-BT8D-WYR20', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'HY4TO8', NULL, 239, 9000, NULL, NULL, '2019-10-08 08:50:21', '2019-10-08 09:50:21', '2019-10-08 09:50:21', NULL),
392(23, 'E2B-B5G8-3V5Y5', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'LRPNUF', NULL, 240, 7, NULL, NULL, '2019-10-08 09:18:03', '2019-10-08 10:18:03', '2019-10-08 10:18:03', NULL),
393(24, 'E2B-SOZD-RHTB3', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'PEAA7Q', NULL, 241, 70, NULL, NULL, '2019-10-08 10:20:11', '2019-10-08 11:20:11', '2019-10-08 11:20:11', NULL),
394(25, 'E2B-YAAF-D4TK0', '4568c8dc-23cb-479b-aae9-acf4ef71210e', 'mb', 'pending', '11683', '831002392', NULL, NULL, NULL, 'a2f04837-49f1-4470-8e03-b5f9bb897b0f', 242, 7, NULL, NULL, '2019-10-08 10:26:22', '2019-10-08 11:26:22', '2019-10-08 11:26:22', NULL),
395(26, 'E2B-9ZJZ-KDDF9', '8af86850-312a-4b77-8a78-5eb92b3c8836', 'mb', 'pending', '11683', '831003652', NULL, NULL, NULL, '809200a1-27ca-4afc-9f31-2f0f0be86566', 243, 70, NULL, NULL, '2019-10-08 10:27:12', '2019-10-08 11:27:12', '2019-10-08 11:27:12', NULL),
396(27, 'E2B-NA0Q-HVDC6', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', '9WMOFO', NULL, 244, 70, NULL, NULL, '2019-10-08 10:29:40', '2019-10-08 11:29:40', '2019-10-08 11:29:40', NULL),
397(28, 'E2B-VQF6-YNFI2', '3b2ded2c-cf13-47c9-bef1-b34ea3c83e71', 'mb', 'pending', '11683', '831003700', NULL, NULL, NULL, '12367cae-d855-417a-8924-497f339ae912', 245, 70, NULL, NULL, '2019-10-08 10:49:56', '2019-10-08 11:49:56', '2019-10-08 11:49:56', NULL),
398(29, 'E2B-98U1-PPZM0', 'fc5a7b71-d43c-4023-a6b9-ba8b4a948208', 'mb', 'pending', '11683', '831003851', NULL, NULL, NULL, '79ed2a2e-d063-46ec-a797-a9139bbfa9ed', 246, 70, NULL, NULL, '2019-10-08 11:18:11', '2019-10-08 12:18:11', '2019-10-08 12:18:11', NULL),
399(30, 'E2B-0MLK-UX2F8', '3780426f-676a-4110-b07a-eccbcec5babf', 'mb', 'pending', '11683', '831002273', NULL, NULL, NULL, '06e76455-4322-4770-b84a-4100b834ab50', 247, 3000, NULL, NULL, '2019-10-08 13:54:34', '2019-10-08 14:54:34', '2019-10-08 14:54:34', NULL),
400(31, 'E2B-WRKC-BEN67', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'ZZCC26', NULL, 248, 70, NULL, NULL, '2019-10-08 14:23:35', '2019-10-08 15:23:35', '2019-10-08 15:23:35', NULL),
401(32, 'E2B-HBXJ-4BQP8', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'EFTBTN', NULL, 250, 70, NULL, NULL, '2019-10-08 16:00:42', '2019-10-08 17:00:42', '2019-10-08 17:00:42', NULL),
402(33, 'E2B-DLPS-EWBI0', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'FPF2XZ', NULL, 251, 70, NULL, NULL, '2019-10-08 16:49:36', '2019-10-08 17:49:36', '2019-10-08 17:49:36', NULL),
403(34, 'E2B-PW3M-NVVJ4', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'BMQVYO', NULL, 252, 230, NULL, NULL, '2019-10-08 17:00:46', '2019-10-08 18:00:46', '2019-10-08 18:00:46', NULL),
404(35, 'E2B-EBAR-YT892', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'IBCOFA', NULL, 255, 70, NULL, NULL, '2019-10-10 09:37:08', '2019-10-10 10:37:08', '2019-10-10 10:37:08', NULL),
405(36, 'E2B-RIXY-MGOG8', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'MAA1FT', NULL, 256, 70, NULL, NULL, '2019-10-10 09:39:33', '2019-10-10 10:39:33', '2019-10-10 10:39:33', NULL),
406(37, 'E2B-QSLT-MA4J0', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', '6KIHJ1', NULL, 258, 70, NULL, NULL, '2019-10-10 09:59:43', '2019-10-10 10:59:43', '2019-10-10 10:59:43', NULL),
407(38, 'E2B-ZJGP-NCOZ8', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'Z8JIMC', NULL, 259, 70, NULL, NULL, '2019-10-10 10:01:38', '2019-10-10 11:01:38', '2019-10-10 11:01:38', NULL),
408(39, 'E2B-F9WS-HOAJ9', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'QEVZID', NULL, 260, 70, NULL, NULL, '2019-10-10 10:02:20', '2019-10-10 11:02:20', '2019-10-10 11:02:20', NULL),
409(40, 'E2B-CMGL-RPZO2', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'VIHW4R', NULL, 261, 70, NULL, NULL, '2019-10-10 10:11:53', '2019-10-10 11:11:53', '2019-10-10 11:11:53', NULL),
410(41, 'E2B-HOFM-DCL11', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'S50R8V', NULL, 262, 150, NULL, NULL, '2019-10-10 13:24:45', '2019-10-10 14:24:45', '2019-10-15 17:25:11', NULL),
411(42, 'E2B-X7YU-HVCV1', NULL, 'wt', 'paid', NULL, NULL, NULL, 'PT500000000000000000', 'GT8PAC', NULL, 263, 100, NULL, NULL, '2019-10-11 08:47:57', '2019-10-11 09:47:57', '2019-10-15 17:21:19', NULL),
412(43, 'E2B-F6GI-MGHG7', '6421f968-39ad-4fd9-9eac-ff99580e6c61', 'mb', 'pending', '11683', '831006438', NULL, NULL, NULL, '7340d0a0-c319-4599-a1cf-56701ea1ed7a', 266, 70, NULL, NULL, '2019-10-15 11:32:39', '2019-10-15 12:32:39', '2019-10-15 12:32:39', NULL),
413(44, 'E2B-RZXQ-VFGC5', 'db5a1cc2-af56-4e5e-bc38-8da149e5923c', 'mb', 'pending', '11683', '831006586', NULL, NULL, NULL, '6559104f-a769-4302-b21b-4a1657ac211a', 271, 70, NULL, NULL, '2019-10-15 13:28:48', '2019-10-15 14:28:48', '2019-10-15 14:28:48', NULL),
414(45, 'E2B-ZKWK-GZAT1', 'c3feb653-0849-4571-9e9b-1b413333da06', 'mb', 'pending', '11683', '831006637', NULL, NULL, NULL, '673bda5a-f79b-48ee-b118-00161bb99935', 272, 70, NULL, NULL, '2019-10-15 13:48:35', '2019-10-15 14:48:35', '2019-10-15 14:48:35', NULL),
415(46, 'E2B-5P3K-TYTI2', '9bae8554-7a4f-4870-98d7-15f9b308b290', 'mb', 'pending', '11683', '831006785', NULL, NULL, NULL, '7a3b2ba8-6f84-4a6e-adbb-310eb35ad52c', 273, 70, NULL, NULL, '2019-10-15 14:10:36', '2019-10-15 15:10:36', '2019-10-15 15:10:36', NULL),
416(47, 'E2B-1EAM-BJEK9', 'df5256ee-3977-43d6-ab74-75867626d7eb', 'mb', 'pending', '11683', '831006836', NULL, NULL, NULL, '021f2fa0-814a-44bb-b599-fe0e6a569e95', 274, 70, NULL, NULL, '2019-10-15 14:19:27', '2019-10-15 15:19:27', '2019-10-15 15:19:27', NULL),
417(48, 'E2B-EKIL-AIGB1', 'dfd50fbd-2358-4d15-8664-fac849fd14f9', 'mb', 'pending', '11683', '831006984', NULL, NULL, NULL, '8fefd606-8000-4b6f-8912-7d9fd3069187', 277, 70, NULL, NULL, '2019-10-15 14:27:03', '2019-10-15 15:27:03', '2019-10-15 15:27:03', NULL),
418(49, 'E2B-HOSI-MHKU6', '01e4c03e-3a9b-4ec2-a067-082bff3df7e4', 'mb', 'pending', '11683', '831007035', NULL, NULL, NULL, 'a004e450-8527-45de-96cd-4e5ab209f91c', 284, 70, NULL, NULL, '2019-10-15 14:45:58', '2019-10-15 15:45:58', '2019-10-15 15:45:58', NULL),
419(50, 'E2B-GD8G-N6620', 'c0341fe5-aff5-4eee-98a9-504a91df6363', 'mb', 'pending', '11683', '831007183', NULL, NULL, NULL, 'f7a9982e-c352-40a5-a9fb-f5be077ad6cb', 286, 70, NULL, NULL, '2019-10-15 16:34:22', '2019-10-15 17:34:22', '2019-10-15 17:34:22', NULL),
420(51, 'E2B-A4FL-5LEH1', NULL, 'wt', 'pending', NULL, NULL, NULL, 'PT500000000000000000', 'ITBALH', NULL, 287, 70, NULL, NULL, '2019-10-16 09:56:33', '2019-10-16 10:56:33', '2019-10-16 10:56:33', NULL),
421(52, 'E2B-8HAY-MMOM5', 'c4236fbb-463b-4300-b650-4c068fab9e87', 'mb', 'pending', '11683', '831007234', NULL, NULL, NULL, '4726ac09-6a9d-4a68-957f-441c365a1dcb', 288, 70, NULL, NULL, '2019-10-16 10:06:34', '2019-10-16 11:06:34', '2019-10-16 11:06:34', NULL),
422(53, 'E2B-SHRU-DXNJ5', 'f4470d41-6124-4b80-8596-337de1677ef7', 'mb', 'pending', '11683', '831007382', NULL, NULL, NULL, '50711800-a707-4565-a65d-12679e8898c5', 289, 70, NULL, NULL, '2019-10-16 10:15:41', '2019-10-16 11:15:41', '2019-10-16 11:15:41', NULL),
423(54, 'E2B-6LDM-PLNN7', '46d6d4c0-f317-45d9-be7d-f9456f3a26d9', 'mb', 'pending', '11683', '831007433', NULL, NULL, NULL, 'f32ed30e-4156-4f5f-bbf3-38e86ea2f9b3', 290, 70, NULL, NULL, '2019-10-16 10:19:44', '2019-10-16 11:19:44', '2019-10-16 11:19:44', NULL),
424(55, 'E2B-WHVH-DKAS8', '58a7b01d-7876-431b-b0e2-03e371ff5f2b', 'mb', 'pending', '11683', '831007581', NULL, NULL, NULL, '32297bd0-5c79-40c1-887a-7dba93453f18', 291, 70, NULL, NULL, '2019-10-16 10:25:35', '2019-10-16 11:25:35', '2019-10-16 11:25:35', NULL),
425(56, 'E2B-MLF5-EDMR3', '56cb35cb-df8f-41e2-8a1c-8de39c8b0c4b', 'cc', 'pending', NULL, NULL, 'https://cc.test.easypay.pt/start/56cb35cb-df8f-41e2-8a1c-8de39c8b0c4b', NULL, NULL, '41bf6eb8-3a02-4dcf-95fd-3000423a0919', 292, 70, NULL, NULL, '2019-10-16 10:26:43', '2019-10-16 11:26:43', '2019-10-16 11:26:43', NULL),
426(57, 'E2B-6V7G-FDKK3', 'ef5b9566-188b-4e0e-8bdf-26544fd45f59', 'mb', 'pending', '11683', '831007632', NULL, NULL, NULL, '6631adf0-6973-4d30-9367-dfa37dc3bec8', 296, 70, NULL, NULL, '2019-10-16 10:45:04', '2019-10-16 11:45:04', '2019-10-16 11:45:04', NULL),
427(58, 'E2B-VFMK-XMVU8', '534fb354-7565-44da-9872-6a2eba674e9e', 'mb', 'pending', '11683', '831007780', NULL, NULL, NULL, '23dc42fa-7a33-402d-ad59-8dd4401a0391', 297, 70, NULL, NULL, '2019-10-16 10:56:01', '2019-10-16 11:56:01', '2019-10-16 11:56:01', NULL),
428(59, 'E2B-LZF6-BHTL0', '434215a7-6157-437c-9fa0-f6ee414cba81', 'mb', 'pending', '11683', '831007831', NULL, NULL, NULL, 'fac2ee33-068d-4e2d-9ca7-e5d5e82d5261', 284, 70, NULL, NULL, '2019-10-16 11:26:07', '2019-10-16 12:26:07', '2019-10-16 12:26:07', NULL),
429(60, 'E2B-6YQG-VCAQ3', '7f2ec4aa-5c43-4ad9-8ea1-183bdc3e24ba', 'mb', 'pending', '11683', '831007979', NULL, NULL, NULL, 'c7228331-7026-42b6-9559-cca82e7e6ae1', 298, 70, NULL, NULL, '2019-10-16 11:30:20', '2019-10-16 12:30:20', '2019-10-16 12:30:20', NULL),
430(61, 'E2B-ZRTM-OA5B4', '5412bee9-4a64-425b-bd7f-7697c3373c2a', 'mb', 'pending', '11683', '831008974', NULL, NULL, NULL, 'a35ac8d5-47f1-4611-b894-e01040ac736f', 302, 70, NULL, NULL, '2019-10-17 09:06:52', '2019-10-17 10:06:52', '2019-10-17 10:06:52', NULL),
431(62, 'E2B-TYZC-UAFX1', 'af6a823c-0c56-4709-a869-ecb5a0bb455d', 'mb', 'pending', '11683', '831009025', NULL, NULL, NULL, '913e3853-431a-4def-9803-680abc6056c4', 303, 70, NULL, NULL, '2019-10-17 09:20:22', '2019-10-17 10:20:22', '2019-10-17 10:20:22', NULL),
432(63, 'E2B-CAGV-GUXU4', 'af82f449-4163-4c90-a1d2-51ba438549dd', 'mb', 'pending', '11683', '831009173', NULL, NULL, NULL, '119dd565-3c94-4eb3-9991-bbbe8be7ade7', 307, 70, NULL, NULL, '2019-10-17 09:38:51', '2019-10-17 10:38:51', '2019-10-17 10:38:51', NULL),
433(64, 'E2B-QBBS-BMKE6', '8e44bdd8-2962-4009-8fd0-37c22064cd95', 'mb', 'pending', '11683', '831009224', NULL, NULL, NULL, '56cfb2ed-9cb9-460e-93e2-bacadcf8eab7', 308, 70, NULL, NULL, '2019-10-17 09:42:39', '2019-10-17 10:42:39', '2019-10-17 10:42:39', NULL),
434(65, 'E2B-6GTF-JVJP9', '87af1b90-9e85-46d6-8bd9-f8360c0698c7', 'mb', 'pending', '11683', '831009372', NULL, NULL, NULL, 'e53dfacd-bc99-41b1-978f-0593f1bb0f22', 309, 70, NULL, NULL, '2019-10-17 09:44:02', '2019-10-17 10:44:02', '2019-10-17 10:44:02', NULL);
435
436DROP TABLE IF EXISTS `easy2b_request_logs`;
437CREATE TABLE `easy2b_request_logs` (
438 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
439 `source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
440 `client_source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
441 `tags` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
442 `response` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
443 `created_at` timestamp NULL DEFAULT NULL,
444 `updated_at` timestamp NULL DEFAULT NULL,
445 PRIMARY KEY (`id`)
446) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
447
448
449DROP TABLE IF EXISTS `easy2b_settings`;
450CREATE TABLE `easy2b_settings` (
451 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
452 `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
453 `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
454 `created_at` timestamp NULL DEFAULT NULL,
455 `updated_at` timestamp NULL DEFAULT NULL,
456 `deleted_at` timestamp NULL DEFAULT NULL,
457 PRIMARY KEY (`id`)
458) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
459
460
461DROP TABLE IF EXISTS `easy2b_sponsors`;
462CREATE TABLE `easy2b_sponsors` (
463 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
464 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
465 `address` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
466 `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
467 `country` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
468 `lat` double(8,2) DEFAULT NULL,
469 `lng` double(8,2) DEFAULT NULL,
470 `mobile_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
471 `landline_phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
472 `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
473 `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
474 `status` int(11) NOT NULL,
475 `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
476 `photo_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
477 `source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
478 `google_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
479 `user_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
480 `created_at` timestamp NULL DEFAULT NULL,
481 `updated_at` timestamp NULL DEFAULT NULL,
482 `deleted_at` timestamp NULL DEFAULT NULL,
483 PRIMARY KEY (`id`)
484) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
485
486
487DROP TABLE IF EXISTS `easy2b_sponsors_activity`;
488CREATE TABLE `easy2b_sponsors_activity` (
489 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
490 `sponsor_id` int(10) unsigned NOT NULL,
491 `action` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
492 `result` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
493 `comments` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
494 `created_at` timestamp NULL DEFAULT NULL,
495 `updated_at` timestamp NULL DEFAULT NULL,
496 `deleted_at` timestamp NULL DEFAULT NULL,
497 PRIMARY KEY (`id`)
498) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
499
500
501DROP TABLE IF EXISTS `easy2b_tags`;
502CREATE TABLE `easy2b_tags` (
503 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
504 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
505 `created_at` timestamp NULL DEFAULT NULL,
506 `updated_at` timestamp NULL DEFAULT NULL,
507 PRIMARY KEY (`id`)
508) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
509
510
511DROP TABLE IF EXISTS `easy2b_target_audiences`;
512CREATE TABLE `easy2b_target_audiences` (
513 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
514 `rule` text COLLATE utf8mb4_unicode_ci NOT NULL,
515 `campaign_id` bigint(20) unsigned NOT NULL,
516 `created_at` timestamp NULL DEFAULT NULL,
517 `updated_at` timestamp NULL DEFAULT NULL,
518 `deleted_at` timestamp NULL DEFAULT NULL,
519 PRIMARY KEY (`id`),
520 KEY `easy2b_target_audiences_campaign_id_index` (`campaign_id`),
521 CONSTRAINT `easy2b_target_audiences_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE
522) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
523
524
525DROP TABLE IF EXISTS `easy2b_templates`;
526CREATE TABLE `easy2b_templates` (
527 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
528 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
529 `code` text COLLATE utf8mb4_unicode_ci NOT NULL,
530 `order` int(11) NOT NULL,
531 `created_at` timestamp NULL DEFAULT NULL,
532 `updated_at` timestamp NULL DEFAULT NULL,
533 `deleted_at` timestamp NULL DEFAULT NULL,
534 PRIMARY KEY (`id`)
535) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
536
537
538DROP TABLE IF EXISTS `easy2b_users_metadata`;
539CREATE TABLE `easy2b_users_metadata` (
540 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
541 `user_id` int(10) unsigned NOT NULL,
542 `nif` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
543 `billing_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
544 `business_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
545 `created_at` timestamp NULL DEFAULT NULL,
546 `updated_at` timestamp NULL DEFAULT NULL,
547 `deleted_at` timestamp NULL DEFAULT NULL,
548 PRIMARY KEY (`id`),
549 KEY `easy2b_users_metadata_user_id_index` (`user_id`),
550 CONSTRAINT `easy2b_users_metadata_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
551) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
552
553
554DROP TABLE IF EXISTS `easy2b_users_roles`;
555CREATE TABLE `easy2b_users_roles` (
556 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
557 `user_id` int(10) unsigned NOT NULL,
558 `role` int(11) NOT NULL DEFAULT '0',
559 `created_at` timestamp NULL DEFAULT NULL,
560 `updated_at` timestamp NULL DEFAULT NULL,
561 PRIMARY KEY (`id`),
562 KEY `easy2b_users_roles_user_id_index` (`user_id`),
563 CONSTRAINT `easy2b_users_roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
564) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
565
566
567DROP TABLE IF EXISTS `easy2b_vouchers`;
568CREATE TABLE `easy2b_vouchers` (
569 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
570 `identifier` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
571 `campaign_id` bigint(20) unsigned NOT NULL,
572 `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
573 `description` text COLLATE utf8mb4_unicode_ci,
574 `text` text COLLATE utf8mb4_unicode_ci,
575 `image_url` text COLLATE utf8mb4_unicode_ci,
576 `image_size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
577 `value` double(8,2) DEFAULT NULL,
578 `url` text COLLATE utf8mb4_unicode_ci,
579 `quantity` int(11) DEFAULT NULL,
580 `percentage` int(11) DEFAULT NULL,
581 `daily_budget` int(11) DEFAULT NULL,
582 `total_budget` int(11) DEFAULT NULL,
583 `start_date` datetime DEFAULT NULL,
584 `end_date` datetime DEFAULT NULL,
585 `state` smallint(6) NOT NULL DEFAULT '1',
586 `paused` tinyint(1) NOT NULL DEFAULT '0',
587 `evaluated_by` int(10) unsigned DEFAULT NULL,
588 `not_approved_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
589 `user_id` int(10) unsigned NOT NULL,
590 `created_at` timestamp NULL DEFAULT NULL,
591 `updated_at` timestamp NULL DEFAULT NULL,
592 `deleted_at` timestamp NULL DEFAULT NULL,
593 PRIMARY KEY (`id`),
594 UNIQUE KEY `easy2b_vouchers_identifier_unique` (`identifier`),
595 KEY `easy2b_vouchers_campaign_id_index` (`campaign_id`),
596 KEY `easy2b_vouchers_evaluated_by_index` (`evaluated_by`),
597 KEY `easy2b_vouchers_user_id_index` (`user_id`),
598 CONSTRAINT `easy2b_vouchers_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
599 CONSTRAINT `easy2b_vouchers_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
600 CONSTRAINT `easy2b_vouchers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
601) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
602
603
604DROP TABLE IF EXISTS `easy2b_vouchers_images`;
605CREATE TABLE `easy2b_vouchers_images` (
606 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
607 `voucher_id` bigint(20) unsigned NOT NULL,
608 `campaign_id` bigint(20) unsigned NOT NULL,
609 `content` longtext COLLATE utf8mb4_unicode_ci,
610 `url` text COLLATE utf8mb4_unicode_ci,
611 `size` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
612 `background_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
613 `logo_url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
614 `created_at` timestamp NULL DEFAULT NULL,
615 `updated_at` timestamp NULL DEFAULT NULL,
616 `deleted_at` timestamp NULL DEFAULT NULL,
617 PRIMARY KEY (`id`),
618 KEY `easy2b_vouchers_images_voucher_id_foreign` (`voucher_id`),
619 KEY `easy2b_vouchers_images_campaign_id_foreign` (`campaign_id`),
620 CONSTRAINT `easy2b_vouchers_images_campaign_id_foreign` FOREIGN KEY (`campaign_id`) REFERENCES `easy2b_campaigns` (`id`) ON DELETE CASCADE,
621 CONSTRAINT `easy2b_vouchers_images_voucher_id_foreign` FOREIGN KEY (`voucher_id`) REFERENCES `easy2b_vouchers` (`id`) ON DELETE CASCADE
622) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
623
624
625DROP TABLE IF EXISTS `failed_jobs`;
626CREATE TABLE `failed_jobs` (
627 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
628 `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
629 `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
630 `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
631 `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
632 `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
633 PRIMARY KEY (`id`)
634) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
635
636
637DROP TABLE IF EXISTS `forum_categories`;
638CREATE TABLE `forum_categories` (
639 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
640 `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
641 `color` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
642 `icon` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
643 `order` int(11) NOT NULL,
644 `created_at` timestamp NULL DEFAULT NULL,
645 `updated_at` timestamp NULL DEFAULT NULL,
646 `deleted_at` timestamp NULL DEFAULT NULL,
647 PRIMARY KEY (`id`),
648 UNIQUE KEY `forum_categories_name_unique` (`name`)
649) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
650
651
652DROP TABLE IF EXISTS `forum_categories_subscribers`;
653CREATE TABLE `forum_categories_subscribers` (
654 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
655 `user_id` int(10) unsigned NOT NULL,
656 `category_id` int(10) unsigned NOT NULL,
657 `created_at` timestamp NULL DEFAULT NULL,
658 `updated_at` timestamp NULL DEFAULT NULL,
659 PRIMARY KEY (`id`),
660 KEY `forum_categories_subscribers_user_id_foreign` (`user_id`),
661 KEY `forum_categories_subscribers_category_id_foreign` (`category_id`),
662 CONSTRAINT `forum_categories_subscribers_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `forum_categories` (`id`) ON DELETE CASCADE,
663 CONSTRAINT `forum_categories_subscribers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
664) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
665
666
667DROP TABLE IF EXISTS `forum_messages`;
668CREATE TABLE `forum_messages` (
669 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
670 `topic_id` int(10) unsigned NOT NULL,
671 `user_id` int(10) unsigned NOT NULL,
672 `text` varchar(10240) COLLATE utf8mb4_unicode_ci NOT NULL,
673 `quote_message` int(10) unsigned DEFAULT NULL,
674 `created_at` timestamp NULL DEFAULT NULL,
675 `updated_at` timestamp NULL DEFAULT NULL,
676 `deleted_at` timestamp NULL DEFAULT NULL,
677 PRIMARY KEY (`id`),
678 KEY `forum_messages_topic_id_foreign` (`topic_id`),
679 KEY `forum_messages_user_id_foreign` (`user_id`),
680 KEY `forum_messages_quote_message_foreign` (`quote_message`),
681 CONSTRAINT `forum_messages_quote_message_foreign` FOREIGN KEY (`quote_message`) REFERENCES `forum_messages` (`id`),
682 CONSTRAINT `forum_messages_topic_id_foreign` FOREIGN KEY (`topic_id`) REFERENCES `forum_topics` (`id`) ON DELETE CASCADE,
683 CONSTRAINT `forum_messages_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
684) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
685
686
687DROP TABLE IF EXISTS `forum_messages_flags`;
688CREATE TABLE `forum_messages_flags` (
689 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
690 `user_id` int(10) unsigned NOT NULL,
691 `message_id` int(10) unsigned NOT NULL,
692 `reason` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
693 `created_at` timestamp NULL DEFAULT NULL,
694 `updated_at` timestamp NULL DEFAULT NULL,
695 `deleted_at` timestamp NULL DEFAULT NULL,
696 PRIMARY KEY (`id`),
697 KEY `forum_messages_flags_user_id_foreign` (`user_id`),
698 KEY `forum_messages_flags_message_id_foreign` (`message_id`),
699 CONSTRAINT `forum_messages_flags_message_id_foreign` FOREIGN KEY (`message_id`) REFERENCES `forum_messages` (`id`) ON DELETE CASCADE,
700 CONSTRAINT `forum_messages_flags_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
701) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
702
703
704DROP TABLE IF EXISTS `forum_topics`;
705CREATE TABLE `forum_topics` (
706 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
707 `pretty_id` text COLLATE utf8mb4_unicode_ci NOT NULL,
708 `category_id` int(10) unsigned NOT NULL,
709 `user_id` int(10) unsigned NOT NULL,
710 `title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
711 `state` int(11) NOT NULL,
712 `message` int(10) unsigned DEFAULT NULL,
713 `created_at` timestamp NULL DEFAULT NULL,
714 `updated_at` timestamp NULL DEFAULT NULL,
715 `deleted_at` timestamp NULL DEFAULT NULL,
716 PRIMARY KEY (`id`),
717 KEY `forum_topics_category_id_foreign` (`category_id`),
718 KEY `forum_topics_user_id_foreign` (`user_id`),
719 CONSTRAINT `forum_topics_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `forum_categories` (`id`) ON DELETE CASCADE,
720 CONSTRAINT `forum_topics_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
721) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
722
723
724DROP TABLE IF EXISTS `forum_topics_subscribers`;
725CREATE TABLE `forum_topics_subscribers` (
726 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
727 `user_id` int(10) unsigned NOT NULL,
728 `topic_id` int(10) unsigned NOT NULL,
729 `created_at` timestamp NULL DEFAULT NULL,
730 `updated_at` timestamp NULL DEFAULT NULL,
731 PRIMARY KEY (`id`),
732 KEY `forum_topics_subscribers_user_id_foreign` (`user_id`),
733 KEY `forum_topics_subscribers_topic_id_foreign` (`topic_id`),
734 CONSTRAINT `forum_topics_subscribers_topic_id_foreign` FOREIGN KEY (`topic_id`) REFERENCES `forum_topics` (`id`) ON DELETE CASCADE,
735 CONSTRAINT `forum_topics_subscribers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
736) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
737
738
739DROP TABLE IF EXISTS `jobs`;
740CREATE TABLE `jobs` (
741 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
742 `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
743 `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
744 `attempts` tinyint(3) unsigned NOT NULL,
745 `reserved_at` int(10) unsigned DEFAULT NULL,
746 `available_at` int(10) unsigned NOT NULL,
747 `created_at` int(10) unsigned NOT NULL,
748 PRIMARY KEY (`id`),
749 KEY `jobs_queue_reserved_at_index` (`queue`,`reserved_at`)
750) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
751
752
753DROP TABLE IF EXISTS `migrations`;
754CREATE TABLE `migrations` (
755 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
756 `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
757 `batch` int(11) NOT NULL,
758 PRIMARY KEY (`id`)
759) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
760
761
762DROP TABLE IF EXISTS `news_reports`;
763CREATE TABLE `news_reports` (
764 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
765 `pretty_id` text COLLATE utf8mb4_unicode_ci NOT NULL,
766 `editorial_report` tinyint(1) NOT NULL,
767 `title` varchar(310) COLLATE utf8mb4_unicode_ci NOT NULL,
768 `title_original` varchar(310) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
769 `what` varchar(310) COLLATE utf8mb4_unicode_ci NOT NULL,
770 `who` varchar(310) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
771 `location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
772 `date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
773 `more_info` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL,
774 `more_info_original` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
775 `latitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
776 `longitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
777 `cover_photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
778 `state` int(11) NOT NULL,
779 `not_approved_reason` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
780 `publish_date` datetime DEFAULT NULL,
781 `evaluated_by` int(10) unsigned DEFAULT NULL,
782 `user_id` int(10) unsigned NOT NULL,
783 `where_latitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
784 `where_longitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
785 `created_at` timestamp NULL DEFAULT NULL,
786 `updated_at` timestamp NULL DEFAULT NULL,
787 `deleted_at` timestamp NULL DEFAULT NULL,
788 PRIMARY KEY (`id`),
789 KEY `news_reports_evaluated_by_foreign` (`evaluated_by`),
790 KEY `news_reports_user_id_foreign` (`user_id`),
791 CONSTRAINT `news_reports_evaluated_by_foreign` FOREIGN KEY (`evaluated_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
792 CONSTRAINT `news_reports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
793) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
794
795
796DROP TABLE IF EXISTS `news_reports_best`;
797CREATE TABLE `news_reports_best` (
798 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
799 `news_report` int(10) unsigned NOT NULL,
800 `user_id` int(10) unsigned NOT NULL,
801 `awarded_by` int(10) unsigned NOT NULL,
802 `challenge_id` int(10) unsigned NOT NULL,
803 `created_at` timestamp NULL DEFAULT NULL,
804 `updated_at` timestamp NULL DEFAULT NULL,
805 `deleted_at` timestamp NULL DEFAULT NULL,
806 PRIMARY KEY (`id`),
807 KEY `news_reports_best_news_report_foreign` (`news_report`),
808 KEY `news_reports_best_user_id_foreign` (`user_id`),
809 KEY `news_reports_best_awarded_by_foreign` (`awarded_by`),
810 KEY `news_reports_best_challenge_id_foreign` (`challenge_id`),
811 CONSTRAINT `news_reports_best_awarded_by_foreign` FOREIGN KEY (`awarded_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
812 CONSTRAINT `news_reports_best_challenge_id_foreign` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE,
813 CONSTRAINT `news_reports_best_news_report_foreign` FOREIGN KEY (`news_report`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
814 CONSTRAINT `news_reports_best_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
815) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
816
817
818DROP TABLE IF EXISTS `news_reports_comments`;
819CREATE TABLE `news_reports_comments` (
820 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
821 `news_report` int(10) unsigned NOT NULL,
822 `user_id` int(10) unsigned NOT NULL,
823 `text` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
824 `state` tinyint(3) unsigned zerofill NOT NULL DEFAULT '001',
825 `created_at` timestamp NULL DEFAULT NULL,
826 `updated_at` timestamp NULL DEFAULT NULL,
827 `deleted_at` timestamp NULL DEFAULT NULL,
828 PRIMARY KEY (`id`),
829 KEY `news_reports_comments_news_report_foreign` (`news_report`),
830 KEY `news_reports_comments_user_id_foreign` (`user_id`),
831 CONSTRAINT `news_reports_comments_news_report_foreign` FOREIGN KEY (`news_report`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
832 CONSTRAINT `news_reports_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
833) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
834
835
836DROP TABLE IF EXISTS `news_reports_comments_flags`;
837CREATE TABLE `news_reports_comments_flags` (
838 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
839 `comment_id` int(10) unsigned NOT NULL,
840 `user_id` int(10) unsigned NOT NULL,
841 `reason` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
842 `state` int(11) NOT NULL,
843 `created_at` timestamp NULL DEFAULT NULL,
844 `updated_at` timestamp NULL DEFAULT NULL,
845 PRIMARY KEY (`id`),
846 KEY `news_reports_comments_flags_comment_id_foreign` (`comment_id`),
847 KEY `news_reports_comments_flags_user_id_foreign` (`user_id`),
848 CONSTRAINT `news_reports_comments_flags_comment_id_foreign` FOREIGN KEY (`comment_id`) REFERENCES `news_reports_comments` (`id`) ON DELETE CASCADE,
849 CONSTRAINT `news_reports_comments_flags_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
850) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
851
852
853DROP TABLE IF EXISTS `news_reports_flags`;
854CREATE TABLE `news_reports_flags` (
855 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
856 `user_id` int(10) unsigned NOT NULL,
857 `news_report` int(10) unsigned NOT NULL,
858 `reason` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
859 `created_at` timestamp NULL DEFAULT NULL,
860 `updated_at` timestamp NULL DEFAULT NULL,
861 `deleted_at` timestamp NULL DEFAULT NULL,
862 PRIMARY KEY (`id`),
863 KEY `news_reports_flags_user_id_foreign` (`user_id`),
864 KEY `news_reports_flags_news_report_foreign` (`news_report`),
865 CONSTRAINT `news_reports_flags_news_report_foreign` FOREIGN KEY (`news_report`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
866 CONSTRAINT `news_reports_flags_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
867) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
868
869
870DROP TABLE IF EXISTS `news_reports_likes`;
871CREATE TABLE `news_reports_likes` (
872 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
873 `user_id` int(10) unsigned NOT NULL,
874 `news_report` int(10) unsigned NOT NULL,
875 `created_at` timestamp NULL DEFAULT NULL,
876 `updated_at` timestamp NULL DEFAULT NULL,
877 `deleted_at` timestamp NULL DEFAULT NULL,
878 PRIMARY KEY (`id`),
879 KEY `news_reports_likes_user_id_foreign` (`user_id`),
880 KEY `news_reports_likes_news_report_foreign` (`news_report`),
881 CONSTRAINT `news_reports_likes_news_report_foreign` FOREIGN KEY (`news_report`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
882 CONSTRAINT `news_reports_likes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
883) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
884
885
886DROP TABLE IF EXISTS `news_reports_media`;
887CREATE TABLE `news_reports_media` (
888 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
889 `url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
890 `content_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
891 `dimensions` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
892 `thumbnail` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
893 `news_report_id` int(10) unsigned NOT NULL,
894 `created_at` timestamp NULL DEFAULT NULL,
895 `updated_at` timestamp NULL DEFAULT NULL,
896 `deleted_at` timestamp NULL DEFAULT NULL,
897 PRIMARY KEY (`id`),
898 KEY `news_reports_media_news_report_id_foreign` (`news_report_id`),
899 CONSTRAINT `news_reports_media_news_report_id_foreign` FOREIGN KEY (`news_report_id`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE
900) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
901
902
903DROP TABLE IF EXISTS `settings`;
904CREATE TABLE `settings` (
905 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
906 `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
907 `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
908 `created_at` timestamp NULL DEFAULT NULL,
909 `updated_at` timestamp NULL DEFAULT NULL,
910 `deleted_at` timestamp NULL DEFAULT NULL,
911 PRIMARY KEY (`id`)
912) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
913
914
915DROP TABLE IF EXISTS `users`;
916CREATE TABLE `users` (
917 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
918 `login_type` int(11) NOT NULL DEFAULT '0',
919 `social_id` text COLLATE utf8mb4_unicode_ci,
920 `role` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
921 `username` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
922 `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
923 `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
924 `display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
925 `profile_photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
926 `location` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
927 `origin` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
928 `gender` int(11) NOT NULL DEFAULT '0',
929 `birthday` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
930 `job` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
931 `scholarship` int(11) NOT NULL DEFAULT '0',
932 `bio` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
933 `avatar` int(10) unsigned DEFAULT NULL,
934 `push_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
935 `latitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
936 `longitude` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
937 `unsubscribe_email` tinyint(4) NOT NULL DEFAULT '0',
938 `unsubscribe_email_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
939 `safe_str` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
940 `balance` float DEFAULT '0',
941 `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
942 `invited_by` int(10) unsigned DEFAULT NULL,
943 `email_confirmed` tinyint(4) DEFAULT '1',
944 `confirm_email_code` text COLLATE utf8mb4_unicode_ci,
945 `created_at` timestamp NULL DEFAULT NULL,
946 `updated_at` timestamp NULL DEFAULT NULL,
947 `deleted_at` timestamp NULL DEFAULT NULL,
948 PRIMARY KEY (`id`),
949 UNIQUE KEY `users_username_unique` (`username`),
950 UNIQUE KEY `users_email_unique` (`email`),
951 KEY `users_avatar_foreign` (`avatar`),
952 KEY `invited_by` (`invited_by`),
953 CONSTRAINT `users_avatar_foreign` FOREIGN KEY (`avatar`) REFERENCES `avatars` (`id`),
954 CONSTRAINT `users_ibfk_1` FOREIGN KEY (`invited_by`) REFERENCES `users` (`id`)
955) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
956
957
958DROP TABLE IF EXISTS `users_badges`;
959CREATE TABLE `users_badges` (
960 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
961 `user_id` int(10) unsigned NOT NULL,
962 `challenge_id` int(10) unsigned NOT NULL,
963 `reward_id` int(10) unsigned NOT NULL,
964 `created_at` timestamp NULL DEFAULT NULL,
965 `updated_at` timestamp NULL DEFAULT NULL,
966 `deleted_at` timestamp NULL DEFAULT NULL,
967 PRIMARY KEY (`id`),
968 KEY `users_badges_user_id_foreign` (`user_id`),
969 KEY `users_badges_challenge_id_foreign` (`challenge_id`),
970 KEY `users_badges_reward_id_foreign` (`reward_id`),
971 CONSTRAINT `users_badges_challenge_id_foreign` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE,
972 CONSTRAINT `users_badges_reward_id_foreign` FOREIGN KEY (`reward_id`) REFERENCES `challenges_rewards` (`id`) ON DELETE CASCADE,
973 CONSTRAINT `users_badges_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
974) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
975
976
977DROP TABLE IF EXISTS `users_blocks`;
978CREATE TABLE `users_blocks` (
979 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
980 `user_id` int(10) unsigned NOT NULL,
981 `blocked_id` int(10) unsigned NOT NULL,
982 `created_at` timestamp NULL DEFAULT NULL,
983 `updated_at` timestamp NULL DEFAULT NULL,
984 PRIMARY KEY (`id`),
985 KEY `users_blocks_user_id_foreign` (`user_id`),
986 KEY `users_blocks_blocked_id_foreign` (`blocked_id`),
987 CONSTRAINT `users_blocks_blocked_id_foreign` FOREIGN KEY (`blocked_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
988 CONSTRAINT `users_blocks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
989) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
990
991
992DROP TABLE IF EXISTS `users_challenges`;
993CREATE TABLE `users_challenges` (
994 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
995 `user_id` int(10) unsigned NOT NULL,
996 `challenge_id` int(10) unsigned NOT NULL,
997 `created_at` timestamp NULL DEFAULT NULL,
998 `updated_at` timestamp NULL DEFAULT NULL,
999 `deleted_at` timestamp NULL DEFAULT NULL,
1000 PRIMARY KEY (`id`),
1001 KEY `users_challenges_user_id_foreign` (`user_id`),
1002 KEY `users_challenges_challenge_id_foreign` (`challenge_id`),
1003 CONSTRAINT `users_challenges_challenge_id_foreign` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE,
1004 CONSTRAINT `users_challenges_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1005) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1006
1007
1008DROP TABLE IF EXISTS `users_conversations`;
1009CREATE TABLE `users_conversations` (
1010 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1011 `user_1` int(10) unsigned NOT NULL,
1012 `user_2` int(10) unsigned NOT NULL,
1013 `created_at` timestamp NULL DEFAULT NULL,
1014 `updated_at` timestamp NULL DEFAULT NULL,
1015 `deleted_at` timestamp NULL DEFAULT NULL,
1016 PRIMARY KEY (`id`),
1017 KEY `users_conversations_user_1_foreign` (`user_1`),
1018 KEY `users_conversations_user_2_foreign` (`user_2`),
1019 CONSTRAINT `users_conversations_user_1_foreign` FOREIGN KEY (`user_1`) REFERENCES `users` (`id`) ON DELETE CASCADE,
1020 CONSTRAINT `users_conversations_user_2_foreign` FOREIGN KEY (`user_2`) REFERENCES `users` (`id`) ON DELETE CASCADE
1021) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1022
1023
1024DROP TABLE IF EXISTS `users_friends`;
1025CREATE TABLE `users_friends` (
1026 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1027 `user_1` int(10) unsigned NOT NULL,
1028 `user_2` int(10) unsigned NOT NULL,
1029 `created_at` timestamp NULL DEFAULT NULL,
1030 `updated_at` timestamp NULL DEFAULT NULL,
1031 `deleted_at` timestamp NULL DEFAULT NULL,
1032 PRIMARY KEY (`id`),
1033 KEY `users_friends_user_1_foreign` (`user_1`),
1034 KEY `users_friends_user_2_foreign` (`user_2`),
1035 CONSTRAINT `users_friends_user_1_foreign` FOREIGN KEY (`user_1`) REFERENCES `users` (`id`) ON DELETE CASCADE,
1036 CONSTRAINT `users_friends_user_2_foreign` FOREIGN KEY (`user_2`) REFERENCES `users` (`id`) ON DELETE CASCADE
1037) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1038
1039
1040DROP TABLE IF EXISTS `users_friends_requests`;
1041CREATE TABLE `users_friends_requests` (
1042 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1043 `from` int(10) unsigned NOT NULL,
1044 `to` int(10) unsigned NOT NULL,
1045 `created_at` timestamp NULL DEFAULT NULL,
1046 `updated_at` timestamp NULL DEFAULT NULL,
1047 `deleted_at` timestamp NULL DEFAULT NULL,
1048 PRIMARY KEY (`id`),
1049 KEY `users_friends_requests_from_foreign` (`from`),
1050 KEY `users_friends_requests_to_foreign` (`to`),
1051 CONSTRAINT `users_friends_requests_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE,
1052 CONSTRAINT `users_friends_requests_to_foreign` FOREIGN KEY (`to`) REFERENCES `users` (`id`) ON DELETE CASCADE
1053) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1054
1055
1056DROP TABLE IF EXISTS `users_invites`;
1057CREATE TABLE `users_invites` (
1058 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1059 `from` int(10) unsigned NOT NULL,
1060 `to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
1061 `recipient_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
1062 `created_at` timestamp NULL DEFAULT NULL,
1063 `updated_at` timestamp NULL DEFAULT NULL,
1064 `deleted_at` timestamp NULL DEFAULT NULL,
1065 PRIMARY KEY (`id`),
1066 UNIQUE KEY `users_invites_to_unique` (`to`),
1067 KEY `users_invites_from_foreign` (`from`),
1068 CONSTRAINT `users_invites_from_foreign` FOREIGN KEY (`from`) REFERENCES `users` (`id`) ON DELETE CASCADE
1069) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1070
1071
1072DROP TABLE IF EXISTS `users_invites_sent`;
1073CREATE TABLE `users_invites_sent` (
1074 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1075 `user_id` int(10) unsigned NOT NULL,
1076 `created_at` timestamp NULL DEFAULT NULL,
1077 `updated_at` timestamp NULL DEFAULT NULL,
1078 `deleted_at` timestamp NULL DEFAULT NULL,
1079 PRIMARY KEY (`id`),
1080 KEY `users_invites_sent_user_id_foreign` (`user_id`),
1081 CONSTRAINT `users_invites_sent_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1082) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1083
1084
1085DROP TABLE IF EXISTS `users_password_resets`;
1086CREATE TABLE `users_password_resets` (
1087 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1088 `user_id` int(10) unsigned NOT NULL,
1089 `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
1090 `created_at` timestamp NULL DEFAULT NULL,
1091 `updated_at` timestamp NULL DEFAULT NULL,
1092 `expired_at` datetime NOT NULL,
1093 `deleted_at` timestamp NULL DEFAULT NULL,
1094 PRIMARY KEY (`id`),
1095 KEY `users_password_resets_user_id_foreign` (`user_id`),
1096 CONSTRAINT `users_password_resets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1097) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1098
1099
1100DROP TABLE IF EXISTS `users_permissions`;
1101CREATE TABLE `users_permissions` (
1102 `id` int(11) NOT NULL,
1103 `description` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
1104 `reader` tinyint(1) NOT NULL,
1105 `world_reporter` tinyint(1) NOT NULL,
1106 `subscriber` tinyint(1) NOT NULL,
1107 `ambassador` tinyint(1) NOT NULL,
1108 `created_at` timestamp NULL DEFAULT NULL,
1109 `updated_at` timestamp NULL DEFAULT NULL,
1110 UNIQUE KEY `users_permissions_id_unique` (`id`)
1111) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1112
1113
1114DROP TABLE IF EXISTS `users_points`;
1115CREATE TABLE `users_points` (
1116 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1117 `user_id` int(10) unsigned NOT NULL,
1118 `value` int(11) NOT NULL,
1119 `report_id` int(10) unsigned DEFAULT NULL,
1120 `like_id` int(10) unsigned DEFAULT NULL,
1121 `report_award_id` int(10) unsigned DEFAULT NULL,
1122 `invited_user_id` int(10) unsigned DEFAULT NULL,
1123 `created_at` timestamp NULL DEFAULT NULL,
1124 `updated_at` timestamp NULL DEFAULT NULL,
1125 `deleted_at` timestamp NULL DEFAULT NULL,
1126 PRIMARY KEY (`id`),
1127 KEY `users_points_user_id_foreign` (`user_id`),
1128 KEY `users_points_report_id_foreign` (`report_id`),
1129 KEY `users_points_like_id_foreign` (`like_id`),
1130 KEY `users_points_report_award_id_foreign` (`report_award_id`),
1131 KEY `users_points_invited_user_id_foreign` (`invited_user_id`),
1132 CONSTRAINT `users_points_invited_user_id_foreign` FOREIGN KEY (`invited_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
1133 CONSTRAINT `users_points_like_id_foreign` FOREIGN KEY (`like_id`) REFERENCES `news_reports_likes` (`id`) ON DELETE CASCADE,
1134 CONSTRAINT `users_points_report_award_id_foreign` FOREIGN KEY (`report_award_id`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
1135 CONSTRAINT `users_points_report_id_foreign` FOREIGN KEY (`report_id`) REFERENCES `news_reports` (`id`) ON DELETE CASCADE,
1136 CONSTRAINT `users_points_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
1137) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1138
1139
1140DROP TABLE IF EXISTS `users_private_messages`;
1141CREATE TABLE `users_private_messages` (
1142 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1143 `conversation_id` int(10) unsigned NOT NULL,
1144 `author` int(10) unsigned NOT NULL,
1145 `text` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
1146 `state` int(11) NOT NULL,
1147 `created_at` timestamp NULL DEFAULT NULL,
1148 `updated_at` timestamp NULL DEFAULT NULL,
1149 `deleted_at` timestamp NULL DEFAULT NULL,
1150 PRIMARY KEY (`id`),
1151 KEY `users_private_messages_conversation_id_foreign` (`conversation_id`),
1152 KEY `users_private_messages_author_foreign` (`author`),
1153 CONSTRAINT `users_private_messages_author_foreign` FOREIGN KEY (`author`) REFERENCES `users` (`id`) ON DELETE CASCADE,
1154 CONSTRAINT `users_private_messages_conversation_id_foreign` FOREIGN KEY (`conversation_id`) REFERENCES `users_conversations` (`id`) ON DELETE CASCADE
1155) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1156
1157
1158-- 2020-02-26 17:24:27