-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevents.sql
216 lines (173 loc) · 6.03 KB
/
events.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
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 04, 2022 at 09:04 PM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `events`
--
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`idcomments` int(11) NOT NULL,
`commentBody` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`username` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`events_idevents` int(11) NOT NULL,
`users_idusers` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `comments`
--
INSERT INTO `comments` (`idcomments`, `commentBody`, `username`, `events_idevents`, `users_idusers`) VALUES
(24, 'Such a good cause. ', 'rhythm', 11, 4);
-- --------------------------------------------------------
--
-- Table structure for table `donations`
--
CREATE TABLE `donations` (
`idDonations` int(11) NOT NULL,
`username` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`message` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`amount` int(11) NOT NULL,
`users_idusers` int(11) NOT NULL,
`events_idevents` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `donations`
--
INSERT INTO `donations` (`idDonations`, `username`, `message`, `amount`, `users_idusers`, `events_idevents`) VALUES
(11, 'Rhythm', 'Wish you all the best.', 1500, 4, 11);
-- --------------------------------------------------------
--
-- Table structure for table `events`
--
CREATE TABLE `events` (
`idevents` int(11) NOT NULL,
`title` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(5000) COLLATE utf8mb4_unicode_ci NOT NULL,
`goal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `events`
--
INSERT INTO `events` (`idevents`, `title`, `description`, `goal`) VALUES
(11, 'Help Build a Water Well in Bangladesh', 'Salaams everyone, I hope you are well keeping well. Inshallah my next project is to raise £600 to build a much needed water well in the poorest part of Bangladesh. Please donate what you can, and inshallah you will all be in our duas! ', 50000),
(12, 'Provide Meals for Orphans in Bangladesh', ' The funding provided would be used in order to give the children daily meals, clothing and resources to help support their journey in practicing Islam (i.e., will provide them with Qurans, prayer mats, etc.).', 40000);
-- --------------------------------------------------------
--
-- Table structure for table `reports`
--
CREATE TABLE `reports` (
`idreports` int(11) NOT NULL,
`username` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`complaints` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`event` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`idusers` int(11) NOT NULL,
`username` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`idusers`, `username`, `password`) VALUES
(2, 'arnob', '20101129'),
(3, 'admin', 'password'),
(4, 'rhythm', '20101298');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`idcomments`),
ADD KEY `fk_comments_events_idx` (`events_idevents`),
ADD KEY `fk_comments_users1_idx` (`users_idusers`);
--
-- Indexes for table `donations`
--
ALTER TABLE `donations`
ADD PRIMARY KEY (`idDonations`),
ADD KEY `fk_Donations_users1_idx` (`users_idusers`),
ADD KEY `fk_Donations_events1_idx` (`events_idevents`);
--
-- Indexes for table `events`
--
ALTER TABLE `events`
ADD PRIMARY KEY (`idevents`);
--
-- Indexes for table `reports`
--
ALTER TABLE `reports`
ADD PRIMARY KEY (`idreports`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`idusers`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `idcomments` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `donations`
--
ALTER TABLE `donations`
MODIFY `idDonations` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `events`
--
ALTER TABLE `events`
MODIFY `idevents` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `reports`
--
ALTER TABLE `reports`
MODIFY `idreports` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `idusers` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `fk_comments_events` FOREIGN KEY (`events_idevents`) REFERENCES `events` (`idevents`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_comments_users1` FOREIGN KEY (`users_idusers`) REFERENCES `users` (`idusers`);
--
-- Constraints for table `donations`
--
ALTER TABLE `donations`
ADD CONSTRAINT `fk_Donations_events1` FOREIGN KEY (`events_idevents`) REFERENCES `events` (`idevents`) ON DELETE CASCADE,
ADD CONSTRAINT `fk_Donations_users1` FOREIGN KEY (`users_idusers`) REFERENCES `users` (`idusers`);
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 */;