-
Notifications
You must be signed in to change notification settings - Fork 0
/
store_manger.sql
239 lines (194 loc) · 6.45 KB
/
store_manger.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
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 18, 2022 at 10:42 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `store_manger`
--
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
CREATE TABLE `admins` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`email` varchar(45) DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
`status` tinyint(4) DEFAULT NULL,
`title` varchar(45) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `admins`
--
INSERT INTO `admins` (`id`, `name`, `email`, `password`, `status`, `title`, `description`, `token`) VALUES
(1, 'Admin', 'admin@admin.com', 'password', 1, 'Super Admin', 'Super Admin', NULL),
(12, 'Savannah Strickland', 'xesypiro@mailinator.com', 'Pa$$w0rd!', 1, 'Quo suscipit porro i', 'Amet cumque laudant', NULL),
(13, 'Nayda Goodman', 'budeg@mailinator.com', 'Pa$$w0rd!', 0, 'Ut facere aut in occ', 'Et commodo aut eius ', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `category`
--
CREATE TABLE `category` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `category`
--
INSERT INTO `category` (`id`, `name`, `description`) VALUES
(13, 'Electronic', 'Electronic devices mobile phones refrigerators'),
(14, 'Games', 'Electronic games and video games PlayStation'),
(15, 'Clothes', 'Summer and winter clothes for all seasons'),
(16, 'Sports', 'Sports devices mobile phones refrigerators'),
(17, 'Gym', 'Gym where you can find all the sports equipment');
-- --------------------------------------------------------
--
-- Table structure for table `rating`
--
CREATE TABLE `rating` (
`id` int(11) NOT NULL,
`like` tinyint(4) NOT NULL,
`dislike` tinyint(4) NOT NULL,
`users_id` int(11) NOT NULL,
`stor_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rating`
--
INSERT INTO `rating` (`id`, `like`, `dislike`, `users_id`, `stor_id`) VALUES
(20, 1, 0, 8, 28);
-- --------------------------------------------------------
--
-- Table structure for table `store`
--
CREATE TABLE `store` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`phone` varchar(45) NOT NULL,
`logo` varchar(255) NOT NULL,
`category_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `store`
--
INSERT INTO `store` (`id`, `name`, `description`, `phone`, `logo`, `category_id`) VALUES
(26, 'Bruno Wise', 'Non ad expedita fugi', '+1 (657) 882-3506', '/uploder/images/Bruno WiseEuYPry3XEAUHmEr-e1613513834736.jpg', 16),
(27, 'Diana Hines', 'Sequi mollit anim ac', '+1 (989) 584-4866', '/uploder/images/Diana Hinesdesignssport_03.jpg', 14),
(28, 'Jaden Bass', 'Voluptate sequi sint', '+1 (301) 279-2102', '/uploder/images/Jaden Bassphoto-1588421357574-87938a86fa28.jpg', 14),
(29, 'Karina Mcgee', 'Incidunt eligendi a', '+1 (308) 776-5181', '/uploder/images/Karina Mcgee1-1420248.jpg', 15);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`email` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
`token` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `token`) VALUES
(1, 'Ahmad', 'Ahmad@ahmad.com', '234567', 'eRt4gG6iNXVUWx/DThq[nb8K3L*VUQlxfsTkl8R'),
(2, 'Omer', 'Omer@agm.com3456789', '345678', NULL),
(7, 'Dora', 'dora@name.com', '123456', 'eRtw8rB4CwS28bvUhaVl[gwVxZurAaRNDsTkl8R'),
(8, 'ahmad', 'ahmad1@gmail.com', '123456', 'eRt[8hhh/oUSv3GXDrNBXh6CcYgwTMY[OsTkl8R'),
(9, 'User', 'user@user.com', 'password', NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `token` (`token`);
--
-- Indexes for table `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rating`
--
ALTER TABLE `rating`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_rating_users1_idx` (`users_id`),
ADD KEY `fk_rating_stor1_idx` (`stor_id`);
--
-- Indexes for table `store`
--
ALTER TABLE `store`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_stor_category_idx` (`category_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `token` (`token`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `rating`
--
ALTER TABLE `rating`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `store`
--
ALTER TABLE `store`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `rating`
--
ALTER TABLE `rating`
ADD CONSTRAINT `fk_rating_stor1` FOREIGN KEY (`stor_id`) REFERENCES `store` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_rating_users1` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `store`
--
ALTER TABLE `store`
ADD CONSTRAINT `fk_stor_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;