source: mcquick.sql

Last change on this file was 8491dea, checked in by Agnibho Mondal <mail@…>, 4 years ago

Rewritten for server installation

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**********************************************************************
2 * Title: MCQuick
3 * Description: Application for creating and solving MCQ papers
4 * Author: Agnibho Mondal
5 * Website: http://code.agnibho.com
6 **********************************************************************
7   Copyright (c) 2014-2015 Agnibho Mondal
8   All rights reserved
9 **********************************************************************
10   This file is part of MCQuick.
11   
12   MCQuick is free software: you can redistribute it and/or modify
13   it under the terms of the GNU General Public License as published by
14   the Free Software Foundation, either version 3 of the License, or
15   (at your option) any later version.
16   
17   MCQuick is distributed in the hope that it will be useful,
18   but WITHOUT ANY WARRANTY; without even the implied warranty of
19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20   GNU General Public License for more details.
21   
22   You should have received a copy of the GNU General Public License
23   along with MCQuick.  If not, see <http://www.gnu.org/licenses/>.
24 **********************************************************************/
25SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
26SET time_zone = "+00:00";
27
28/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
29/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
30/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
31/*!40101 SET NAMES utf8mb4 */;
32
33
34CREATE TABLE `papers` (
35  `paper_id` int(11) NOT NULL,
36  `user_id` int(11) NOT NULL,
37  `timestamp` int(11) NOT NULL,
38  `title` varchar(256) NOT NULL,
39  `info` text NOT NULL,
40  `author` varchar(256) NOT NULL,
41  `subject` varchar(32) NOT NULL,
42  `options` int(11) NOT NULL,
43  `multiple` tinyint(1) NOT NULL,
44  `negative` int(11) NOT NULL,
45  `time` varchar(32) NOT NULL,
46  `content` text NOT NULL
47) ENGINE=InnoDB DEFAULT CHARSET=latin1;
48
49CREATE TABLE `record` (
50  `id` int(11) NOT NULL,
51  `user_id` int(11) NOT NULL,
52  `paper_id` int(11) NOT NULL,
53  `content` text NOT NULL,
54  `time` int(11) NOT NULL
55) ENGINE=InnoDB DEFAULT CHARSET=latin1;
56
57CREATE TABLE `user_account` (
58  `user_id` int(11) NOT NULL,
59  `name` varchar(64) NOT NULL,
60  `email` varchar(64) NOT NULL,
61  `time` int(11) NOT NULL,
62  `pass` varchar(60) NOT NULL,
63  `code` varchar(60) NOT NULL
64) ENGINE=InnoDB DEFAULT CHARSET=latin1;
65
66
67ALTER TABLE `papers`
68  ADD PRIMARY KEY (`paper_id`);
69
70ALTER TABLE `record`
71  ADD PRIMARY KEY (`id`);
72
73ALTER TABLE `user_account`
74  ADD PRIMARY KEY (`user_id`);
75
76
77ALTER TABLE `papers`
78  MODIFY `paper_id` int(11) NOT NULL AUTO_INCREMENT;
79ALTER TABLE `record`
80  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
81ALTER TABLE `user_account`
82  MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;
83/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
84/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
85/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Note: See TracBrowser for help on using the repository browser.