forked from AutomicWeb/pip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ca_db.sql
188 lines (153 loc) · 4.36 KB
/
ca_db.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
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 12, 2018 at 09:56 PM
-- Server version: 5.7.21
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `ca_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `ingredients`
--
CREATE TABLE `ingredients` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`amount` int(11) NOT NULL,
`recipe_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `ingredients`
--
INSERT INTO `ingredients` (`id`, `name`, `amount`, `recipe_id`) VALUES
(1, 'Flour', 400, 1),
(2, 'Sugar', 200, 1),
(3, 'Water', 100, 1),
(4, 'Egg', 50, 1),
(5, 'Flour', 400, 2),
(6, 'Sugar', 200, 2),
(7, 'Water', 100, 2),
(8, 'Egg', 50, 2),
(9, 'Flour', 400, 3),
(10, 'Sugar', 200, 3),
(11, 'Water', 100, 3),
(12, 'Egg', 50, 3),
(13, 'Flour', 400, 4),
(14, 'Sugar', 200, 4),
(15, 'Water', 100, 4),
(16, 'Egg', 50, 4);
-- --------------------------------------------------------
--
-- Table structure for table `recipes`
--
CREATE TABLE `recipes` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `recipes`
--
INSERT INTO `recipes` (`id`, `name`, `description`, `user_id`) VALUES
(1, 'Recipe 1', 'Follow these steps:\r\n1 - Add Ingredient 1\r\n2 - Add Ingredient 2\r\n3 - Mix\r\n4 - Bake for 40 minutes', 8),
(2, 'Recipe 2', 'Follow these steps:\r\n1 - Add Ingredient 1\r\n2 - Add Ingredient 2\r\n3 - Mix\r\n4 - Bake for 40 minutes', 8),
(3, 'Recipe 3', 'Follow these steps:\r\n1 - Add Ingredient 1\r\n2 - Add Ingredient 2\r\n3 - Mix\r\n4 - Bake for 40 minutes', 9),
(4, 'Recipe 4', 'Follow these steps:\r\n1 - Add Ingredient 1\r\n2 - Add Ingredient 2\r\n3 - Mix\r\n4 - Bake for 40 minutes', 9);
-- --------------------------------------------------------
--
-- Table structure for table `sessions`
--
CREATE TABLE `sessions` (
`id` varchar(255) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `sessions`
--
INSERT INTO `sessions` (`id`, `user_id`) VALUES
('b90e9ec982e9f401e718aca4ce98e3da', 8),
('f7915df9110487c3ec13346ceee430d4', 8);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `email`, `password`) VALUES
(8, '[email protected]', '$argon2i$v=19$m=1024,t=2,p=2$UkF5Tk5EeERrcHBRV3VUbg$SixP7/ZPpKPIkP4Gi1YBkTlZc9TPmgybE4Ca3vD7WW4'),
(9, '[email protected]', '$argon2i$v=19$m=1024,t=2,p=2$aEFNMU5DRUkxMHdIaU9SYQ$4qGYvl7YEgBldzARhXB2Jq+iVVhgAzGs53AWkl8JcK4');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `ingredients`
--
ALTER TABLE `ingredients`
ADD PRIMARY KEY (`id`),
ADD KEY `recipe_id` (`recipe_id`);
--
-- Indexes for table `recipes`
--
ALTER TABLE `recipes`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `ingredients`
--
ALTER TABLE `ingredients`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `recipes`
--
ALTER TABLE `recipes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- 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 `ingredients`
--
ALTER TABLE `ingredients`
ADD CONSTRAINT `ingredients_ibfk_1` FOREIGN KEY (`recipe_id`) REFERENCES `recipes` (`id`);
--
-- Constraints for table `recipes`
--
ALTER TABLE `recipes`
ADD CONSTRAINT `recipes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Constraints for table `sessions`
--
ALTER TABLE `sessions`
ADD CONSTRAINT `sessions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);