forked from if-itb/IF3110-2015-T2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstack.sql
193 lines (155 loc) · 6.47 KB
/
stack.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
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 27 Nov 2015 pada 15.05
-- Versi Server: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `stack`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `answer`
--
CREATE TABLE IF NOT EXISTS `answer` (
`id_a` int(9) NOT NULL,
`q_id` int(9) NOT NULL,
`content` text NOT NULL,
`date` datetime NOT NULL,
`vote` int(9) NOT NULL,
`username` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `answer`
--
INSERT INTO `answer` (`id_a`, `q_id`, `content`, `date`, `vote`, `username`, `email`) VALUES
(1001, 1, 'Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 Answer Q 1 ', '2015-11-18 00:24:16', 1, 'tata', ''),
(3001, 3, 'Test answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answerTest answer', '2015-11-26 22:44:21', 0, 'tama', ''),
(4001, 4, 'Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 Answer Q 2 ', '2015-11-18 00:25:02', 0, 'tama', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `question`
--
CREATE TABLE IF NOT EXISTS `question` (
`id_q` int(9) NOT NULL,
`title` varchar(100) NOT NULL,
`content` text NOT NULL,
`vote` int(9) NOT NULL,
`date` datetime NOT NULL,
`username` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `question`
--
INSERT INTO `question` (`id_q`, `title`, `content`, `vote`, `date`, `username`, `email`) VALUES
(1, 'Question by tama', 'test by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by testtest by test\r\n\r\n\r\n\r\n', 2, '2015-11-18 00:05:33', 'tama', ''),
(3, 'Question by tata', 'Test by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tataTest by tata\r\n', 2, '2015-11-18 00:21:11', 'tata', ''),
(4, 'Test by tata2', 'Test by tata2Test by tata2Test by tata2Test by tata2Test by tata2Test by tata2Test by tata2Test by tata2', 0, '2015-11-18 00:23:41', 'tata', ''),
(6, 'Test by tama 3 (edited)', '(edited)Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3Test by tama 3\r\n', 0, '2015-11-18 00:42:52', 'tama', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `registered`
--
CREATE TABLE IF NOT EXISTS `registered` (
`user_id` int(9) NOT NULL,
`username` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `registered`
--
INSERT INTO `registered` (`user_id`, `username`, `email`, `password`) VALUES
(1, 'tama', '[email protected]', 'tama'),
(2, 'tata', '[email protected]', 'tata'),
(8, 'tama126', '[email protected]', 'tatama');
-- --------------------------------------------------------
--
-- Struktur dari tabel `token`
--
CREATE TABLE IF NOT EXISTS `token` (
`token` varchar(100) NOT NULL,
`expire` varchar(100) NOT NULL,
`id_user` int(5) NOT NULL,
`username` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `token`
--
INSERT INTO `token` (`token`, `expire`, `id_user`, `username`) VALUES
('itjahmc', '1447785951', 1, 'tama'),
('otgastsaewq', '1047784904', 2, 'tata'),
('st4ajmva', '1448557484', 1, 'tama'),
('ttpaqmfa', '1448278220', 1, 'tama'),
('ut8ammja', '1448557454', 1, 'tama'),
('wtja6mh', '1447787595', 1, 'tama');
-- --------------------------------------------------------
--
-- Struktur dari tabel `voted`
--
CREATE TABLE IF NOT EXISTS `voted` (
`Kode` varchar(10) NOT NULL,
`id_v` int(9) NOT NULL,
`id_u` int(9) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `voted`
--
INSERT INTO `voted` (`Kode`, `id_v`, `id_u`) VALUES
('1-1', 1, 1),
('1-2', 1, 2),
('1001-1', 1001, 1),
('3-1', 3, 1),
('3-2', 3, 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `answer`
--
ALTER TABLE `answer`
ADD PRIMARY KEY (`id_a`), ADD KEY `q_id` (`q_id`);
--
-- Indexes for table `question`
--
ALTER TABLE `question`
ADD PRIMARY KEY (`id_q`);
--
-- Indexes for table `registered`
--
ALTER TABLE `registered`
ADD PRIMARY KEY (`user_id`), ADD FULLTEXT KEY `password` (`password`);
--
-- Indexes for table `token`
--
ALTER TABLE `token`
ADD UNIQUE KEY `token` (`token`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `registered`
--
ALTER TABLE `registered`
MODIFY `user_id` int(9) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `answer`
--
ALTER TABLE `answer`
ADD CONSTRAINT `answer_ibfk_1` FOREIGN KEY (`q_id`) REFERENCES `question` (`id_q`) ON DELETE CASCADE ON UPDATE NO ACTION;
/*!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 */;