forked from kirilkirkov/Ecommerce-CodeIgniter-Bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.sql
executable file
·414 lines (347 loc) · 12.9 KB
/
database.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
CREATE TABLE IF NOT EXISTS `active_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `active_pages` (`id`, `name`, `enabled`) VALUES
(1, 'blog', 1);
CREATE TABLE IF NOT EXISTS `blog_posts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`image` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`time` int(10) unsigned NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `cookie_law` (
`id` int(10) UNSIGNED NOT NULL,
`link` varchar(255) NOT NULL,
`theme` varchar(20) NOT NULL,
`visibility` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `cookie_law_translations` (
`id` int(10) UNSIGNED NOT NULL,
`message` varchar(255) NOT NULL,
`button_text` varchar(50) NOT NULL,
`learn_more` varchar(50) NOT NULL,
`abbr` varchar(5) NOT NULL,
`for_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `cookie_law`
ADD PRIMARY KEY (`id`);
ALTER TABLE `cookie_law_translations`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQUE` (`abbr`,`for_id`) USING BTREE;
ALTER TABLE `cookie_law`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `cookie_law_translations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
CREATE TABLE `textual_pages_tanslations` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`abbr` varchar(5) NOT NULL,
`for_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `textual_pages_tanslations`
ADD PRIMARY KEY (`id`);
ALTER TABLE `textual_pages_tanslations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `history` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`activity` varchar(255) NOT NULL,
`username` varchar(50) DEFAULT NULL,
`time` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `languages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`abbr` varchar(5) NOT NULL,
`name` varchar(30) NOT NULL,
`currency` varchar(10) NOT NULL,
`currencyKey` varchar(5) NOT NULL,
`flag` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `languages` (`id`, `abbr`, `name`, `currency`, `currencyKey`, `flag`) VALUES
(1, 'bg', 'bulgarian', 'лв', 'BGN', 'bg.jpg'),
(2, 'en', 'english', '$', 'USD', 'en.jpg'),
(3, 'gr', 'greece', 'EUR', 'EUR', 'gr.png'),
(4, 'id', 'indonesian', 'RP', 'IDR', 'id.jpg');
CREATE TABLE IF NOT EXISTS `orders` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL,
`user_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'point to public_users ID',
`products` text NOT NULL,
`date` int(10) unsigned NOT NULL,
`referrer` varchar(255) NOT NULL,
`clean_referrer` varchar(255) NOT NULL,
`payment_type` varchar(255) NOT NULL,
`paypal_status` varchar(10) DEFAULT NULL,
`processed` tinyint(1) NOT NULL DEFAULT '0',
`viewed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'viewed status is change when change processed status',
`confirmed` tinyint(1) NOT NULL DEFAULT '0',
`discount_code` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `orders_clients` (
`id` int(11) NOT NULL,
`first_name` varchar(500) NOT NULL,
`last_name` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`address` text NOT NULL,
`city` varchar(500) NOT NULL,
`post_code` varchar(500) NOT NULL,
`notes` text NOT NULL,
`for_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `orders_clients`
ADD PRIMARY KEY (`id`);
ALTER TABLE `orders_clients`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `users_public` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(100) NOT NULL,
`password` varchar(40) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `users_public`
ADD PRIMARY KEY (`id`);
ALTER TABLE `users_public`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `products` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`folder` int(10) unsigned DEFAULT NULL COMMENT 'folder with images',
`image` varchar(255) NOT NULL,
`time` int(10) unsigned NOT NULL COMMENT 'time created',
`time_update` int(10) unsigned NOT NULL COMMENT 'time updated',
`visibility` tinyint(1) NOT NULL DEFAULT '1',
`shop_categorie` int(11) NOT NULL,
`quantity` int(11) NOT NULL DEFAULT '0',
`procurement` int(10) unsigned NOT NULL,
`in_slider` tinyint(1) NOT NULL DEFAULT '0',
`url` varchar(255) NOT NULL,
`virtual_products` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`brand_id` int(5) DEFAULT NULL,
`position` int(10) UNSIGNED NOT NULL,
`vendor_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `seo_pages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `seo_pages` (`id`, `name`) VALUES
(1, 'home'),
(2, 'checkout'),
(3, 'contacts'),
(4, 'blog');
CREATE TABLE IF NOT EXISTS `shop_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sub_for` int(11) NOT NULL,
`position` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `subscribed` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`browser` varchar(255) NOT NULL,
`ip` varchar(255) NOT NULL,
`time` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
CREATE TABLE `blog_translations` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`abbr` varchar(5) NOT NULL,
`for_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `blog_translations`
ADD PRIMARY KEY (`id`);
ALTER TABLE `blog_translations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `products_translations` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`basic_description` text NOT NULL,
`price` varchar(20) NOT NULL,
`old_price` varchar(20) NOT NULL,
`abbr` varchar(5) NOT NULL,
`for_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `products_translations`
ADD PRIMARY KEY (`id`);
ALTER TABLE `products_translations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `seo_pages_translations` (
`id` int(11) NOT NULL,
`title` varchar(200) NOT NULL,
`description` varchar(200) NOT NULL,
`abbr` varchar(5) NOT NULL,
`page_type` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `seo_pages_translations`
ADD PRIMARY KEY (`id`);
ALTER TABLE `seo_pages_translations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `shop_categories_translations` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`abbr` varchar(5) NOT NULL,
`for_id` int(11) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `shop_categories_translations`
ADD PRIMARY KEY (`id`);
ALTER TABLE `shop_categories_translations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(32) NOT NULL,
`email` varchar(100) NOT NULL,
`notify` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'notifications by email',
`last_login` int(10) UNSIGNED DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
INSERT INTO `users` (`id`, `username`, `password`, `email`, `notify`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', '[email protected]', 0);
CREATE TABLE `bank_accounts` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`iban` varchar(255) NOT NULL,
`bank` varchar(255) NOT NULL,
`bic` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `bank_accounts`
ADD PRIMARY KEY (`id`);
ALTER TABLE `bank_accounts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `value_store` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`thekey` varchar(50) NOT NULL,
`value` longtext NOT NULL,
PRIMARY KEY (`id`),
KEY `key` (`thekey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `value_store` (`id`, `thekey`, `value`) VALUES
(1, 'sitelogo', 'NewLogo.jpg'),
(2, 'navitext', ''),
(3, 'footercopyright', 'Powered by ECC FZE © All right reserved. '),
(4, 'contactspage', 'Hello dear client'),
(5, 'footerContactAddr', ''),
(6, 'footerContactEmail', '[email protected]'),
(7, 'footerContactPhone', ''),
(8, 'googleMaps', '42.671840, 83.279163'),
(9, 'footerAboutUs', ''),
(10, 'footerSocialFacebook', ''),
(11, 'footerSocialTwitter', ''),
(12, 'footerSocialGooglePlus', ''),
(13, 'footerSocialPinterest', ''),
(14, 'footerSocialYoutube', ''),
(16, 'contactsEmailTo', '[email protected]'),
(17, 'shippingOrder', '1'),
(18, 'addJs', ''),
(19, 'publicQuantity', '0'),
(20, 'paypal_email', ''),
(21, 'paypal_sandbox', '0'),
(22, 'publicDateAdded', '0'),
(23, 'googleApi', ''),
(24, 'template', 'redlabel'),
(25, 'cashondelivery_visibility', '1'),
(26, 'showBrands', '0'),
(27, 'showInSlider', '0'),
(28, 'codeDiscounts', '1'),
(29, 'virtualProducts', '0'),
(30, 'multiVendor', '0'),
(31, 'outOfStock', '0'),
(32, 'hideBuyButtonsOfOutOfStock', '0'),
(33, 'moreInfoBtn', ''),
(34, 'refreshAfterAddToCart', 0);
CREATE TABLE `brands` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `confirm_links` (
`id` int(11) NOT NULL,
`link` char(32) NOT NULL,
`for_order` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `confirm_links`
ADD PRIMARY KEY (`id`);
ALTER TABLE `confirm_links`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `discount_codes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(10) NOT NULL,
`code` varchar(10) NOT NULL,
`amount` varchar(20) NOT NULL,
`valid_from_date` int(10) UNSIGNED NOT NULL,
`valid_to_date` int(10) UNSIGNED NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1-enabled, 0-disabled',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `vendors` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`url` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `vendors`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique` (`email`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `vendors`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `vendors_orders` (
`id` int(10) UNSIGNED NOT NULL,
`order_id` int(11) NOT NULL,
`products` text NOT NULL,
`date` int(10) UNSIGNED NOT NULL,
`referrer` varchar(255) NOT NULL,
`clean_referrer` varchar(255) NOT NULL,
`payment_type` varchar(255) NOT NULL,
`paypal_status` varchar(10) DEFAULT NULL,
`processed` tinyint(1) NOT NULL DEFAULT '0',
`viewed` tinyint(1) NOT NULL DEFAULT '0',
`confirmed` tinyint(1) NOT NULL DEFAULT '0',
`discount_code` varchar(20) NOT NULL,
`vendor_id` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `vendors_orders`
ADD PRIMARY KEY (`id`);
ALTER TABLE `vendors_orders`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `vendors_orders_clients` (
`id` int(11) NOT NULL,
`first_name` varchar(500) NOT NULL,
`last_name` varchar(500) NOT NULL,
`email` varchar(500) NOT NULL,
`phone` varchar(500) NOT NULL,
`address` text NOT NULL,
`city` varchar(500) NOT NULL,
`post_code` varchar(500) NOT NULL,
`notes` text NOT NULL,
`for_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `vendors_orders_clients`
ADD PRIMARY KEY (`id`);
ALTER TABLE `vendors_orders_clients`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
CREATE TABLE `keys` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`key` VARCHAR(40) NOT NULL,
`level` INT(2) NOT NULL,
`ignore_limits` TINYINT(1) NOT NULL DEFAULT '0',
`date_created` INT(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;