· 6 years ago · Jun 18, 2019, 03:48 PM
1-- --------------------------------------------------------
2-- Host: 127.0.0.1
3-- Server version: 10.1.38-MariaDB - mariadb.org binary distribution
4-- Server OS: Win64
5-- HeidiSQL Version: 9.5.0.5196
6-- --------------------------------------------------------
7
8/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9/*!40101 SET NAMES utf8 */;
10/*!50503 SET NAMES utf8mb4 */;
11/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13
14
15-- Dumping database structure for stc
16CREATE DATABASE IF NOT EXISTS `stc` /*!40100 DEFAULT CHARACTER SET latin1 */;
17USE `stc`;
18
19-- Dumping structure for table stc.comments
20CREATE TABLE IF NOT EXISTS `comments` (
21 `id` int(255) NOT NULL AUTO_INCREMENT,
22 `user_id` int(255) NOT NULL,
23 `product_id` int(255) NOT NULL,
24 `coment` varchar(500) NOT NULL,
25 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
26 `updated_at` timestamp NULL DEFAULT NULL,
27 PRIMARY KEY (`id`)
28) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
29
30-- Data exporting was unselected.
31-- Dumping structure for table stc.likes
32CREATE TABLE IF NOT EXISTS `likes` (
33 `id` int(255) NOT NULL AUTO_INCREMENT,
34 `user_id` int(255) NOT NULL,
35 `product_id` int(255) NOT NULL,
36 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
37 `updated_at` timestamp NULL DEFAULT NULL,
38 PRIMARY KEY (`id`)
39) ENGINE=InnoDB DEFAULT CHARSET=latin1;
40
41-- Data exporting was unselected.
42-- Dumping structure for table stc.migrations
43CREATE TABLE IF NOT EXISTS `migrations` (
44 `id` int(10) unsigned NOT NULL,
45 `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
46 `batch` int(11) NOT NULL,
47 PRIMARY KEY (`id`)
48) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
49
50-- Data exporting was unselected.
51-- Dumping structure for table stc.orders
52CREATE TABLE IF NOT EXISTS `orders` (
53 `id` int(255) NOT NULL AUTO_INCREMENT,
54 `user_id` int(255) NOT NULL,
55 `product_id` int(255) NOT NULL,
56 `payment_type_id` int(255) NOT NULL,
57 `order_status` enum('PAID','PENDING','PROCESSED','SHIPPED','CANCELED') NOT NULL DEFAULT 'PENDING',
58 `quantity` int(255) NOT NULL,
59 `amount` float NOT NULL DEFAULT '0',
60 `location` varchar(500) NOT NULL,
61 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
62 `updated_at` timestamp NULL DEFAULT NULL,
63 `mod_on` timestamp NULL DEFAULT NULL,
64 `mod_by` int(255) NOT NULL,
65 PRIMARY KEY (`id`)
66) ENGINE=InnoDB DEFAULT CHARSET=latin1;
67
68-- Data exporting was unselected.
69-- Dumping structure for table stc.password_resets
70CREATE TABLE IF NOT EXISTS `password_resets` (
71 `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
72 `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
73 `created_at` timestamp NULL DEFAULT NULL,
74 KEY `password_resets_email_index` (`email`(191))
75) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
76
77-- Data exporting was unselected.
78-- Dumping structure for table stc.payments
79CREATE TABLE IF NOT EXISTS `payments` (
80 `id` int(255) NOT NULL AUTO_INCREMENT,
81 `user_id` int(255) NOT NULL,
82 `order_id` int(255) NOT NULL,
83 `payment_type` enum('CARD','CASH','MOMO') NOT NULL,
84 `extra_info` text NOT NULL,
85 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
86 `updated_at` timestamp NULL DEFAULT NULL,
87 `mod_on` timestamp NULL DEFAULT NULL,
88 `mod_by` int(255) NOT NULL,
89 PRIMARY KEY (`id`)
90) ENGINE=InnoDB DEFAULT CHARSET=latin1;
91
92-- Data exporting was unselected.
93-- Dumping structure for table stc.products
94CREATE TABLE IF NOT EXISTS `products` (
95 `id` int(255) NOT NULL AUTO_INCREMENT,
96 `category_id` int(255) NOT NULL,
97 `name` varchar(500) NOT NULL DEFAULT '',
98 `price` float NOT NULL DEFAULT '0',
99 `description` varchar(500) NOT NULL,
100 `pictures` text NOT NULL,
101 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
102 `updated_at` timestamp NULL DEFAULT NULL,
103 `deleted` enum('1','0') NOT NULL DEFAULT '0',
104 PRIMARY KEY (`id`)
105) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
106
107-- Data exporting was unselected.
108-- Dumping structure for table stc.product_categories
109CREATE TABLE IF NOT EXISTS `product_categories` (
110 `id` int(11) NOT NULL AUTO_INCREMENT,
111 `name` varchar(500) NOT NULL,
112 `icon` varchar(500) NOT NULL,
113 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
114 `updated_at` timestamp NULL DEFAULT NULL,
115 `deleted` enum('1','0') NOT NULL DEFAULT '0',
116 PRIMARY KEY (`id`)
117) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
118
119-- Data exporting was unselected.
120-- Dumping structure for table stc.product_sizes
121CREATE TABLE IF NOT EXISTS `product_sizes` (
122 `id` int(255) NOT NULL AUTO_INCREMENT,
123 `category_id` int(255) NOT NULL,
124 `label` varchar(500) NOT NULL DEFAULT '',
125 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
126 `updated_at` timestamp NULL DEFAULT NULL,
127 `deleted` enum('1','0') NOT NULL DEFAULT '0',
128 PRIMARY KEY (`id`)
129) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
130
131-- Data exporting was unselected.
132-- Dumping structure for table stc.users
133CREATE TABLE IF NOT EXISTS `users` (
134 `id` int(10) unsigned NOT NULL,
135 `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
136 `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
137 `email_verified_at` timestamp NULL DEFAULT NULL,
138 `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
139 `admin` tinyint(1) DEFAULT NULL,
140 `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
141 `created_at` timestamp NULL DEFAULT NULL,
142 `updated_at` timestamp NULL DEFAULT NULL,
143 `deleted` enum('1','0') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0'
144) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
145
146-- Data exporting was unselected.
147/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
148/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
149/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;