/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
1
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
2
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
4
5
CREATE SCHEMA IF NOT EXISTS `lenasys` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
6
USE `lenasys` ;
32.1.1 by b11johgu
Added database and example student.
7
-- -----------------------------------------------------
8
CREATE USER 'dbsk'@'localhost' IDENTIFIED BY 'Tomten2009';
32.1.3 by b11johgu
fixed small bugs
9
GRANT ALL PRIVILEGES ON lenasys.* TO 'dbsk'@'localhost' WITH GRANT OPTION;
36.2.1 by Johan Gustavsson
fixed bugg #1170270
10
11
-- -----------------------------------------------------
12
-- Table `lenasys`.`UserTypeCodes`
13
-- -----------------------------------------------------
14
CREATE  TABLE IF NOT EXISTS `lenasys`.`UserTypeCodes` (
15
  `userTypeCode` INT NOT NULL ,
16
  `userType` VARCHAR(10) NOT NULL ,
17
  PRIMARY KEY (`userType`))
18
ENGINE = InnoDB;
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
19
-- -----------------------------------------------------
29.1.3 by b11johgu
changed the order on the tables.
20
-- Table `lenasys`.`Users`
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
21
-- -----------------------------------------------------
36.2.1 by Johan Gustavsson
fixed bugg #1170270
22
29.1.3 by b11johgu
changed the order on the tables.
23
CREATE  TABLE IF NOT EXISTS `lenasys`.`Users` (
24
  `userName` VARCHAR(20) NOT NULL ,
25
  `name` VARCHAR(45) NULL ,
36.2.1 by Johan Gustavsson
fixed bugg #1170270
26
  `passwd` CHAR(40) NULL ,
27
  `userType` INT NULL , -- 0=teacher or 1=student
29.1.4 by b11johgu
changed the order of the attributes in the tables.
28
  `ssn` CHAR(13) NULL COMMENT 'yyyymmdd-xxxx' ,
29.1.3 by b11johgu
changed the order on the tables.
29
  PRIMARY KEY (`userName`) ,
36.2.1 by Johan Gustavsson
fixed bugg #1170270
30
  UNIQUE INDEX `userName_UNIQUE` (`userName` ASC),
31
  INDEX `fk_Users_UserTypeCodes1_idx` (`userType` ASC) ,
32
  CONSTRAINT `fk_Users_usertypeCodes1`
33
    FOREIGN KEY (`userType` )
34
    REFERENCES `lenasys`.`userTypeCodes` (`userTypeCode` )
35
    ON DELETE NO ACTION
36
    ON UPDATE NO ACTION)
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
37
ENGINE = InnoDB;
38
36.2.1 by Johan Gustavsson
fixed bugg #1170270
39
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
40
-- -----------------------------------------------------
41
-- Table `lenasys`.`Courses`
42
-- -----------------------------------------------------
43
CREATE  TABLE IF NOT EXISTS `lenasys`.`Courses` (
44
  `courseID` VARCHAR(10) NOT NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
45
  `name` VARCHAR(45) NULL ,
46
  `courseData` VARCHAR(10) NULL , -- Short explenation about course, example: G1N 7,5hp
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
47
  PRIMARY KEY (`courseID`) ,
48
  UNIQUE INDEX `courseID_UNIQUE` (`courseID` ASC) )
49
ENGINE = InnoDB;
50
29.1.3 by b11johgu
changed the order on the tables.
51
-- -----------------------------------------------------
52
-- Table `lenasys`.`StudentCourseRegistrations`
53
-- -----------------------------------------------------
54
CREATE  TABLE IF NOT EXISTS `lenasys`.`StudentCourseRegistrations` (
29.1.7 by b11johgu
fixed comments and an attribute
55
  `courseOccasion` VARCHAR(16) NOT NULL , -- Example HT2012 period 2
29.1.3 by b11johgu
changed the order on the tables.
56
  `userName` VARCHAR(20) NOT NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
57
  `courseID` VARCHAR(10) NOT NULL , -- Example G14234
58
  PRIMARY KEY (`courseOccasion`,`userName`, `courseID`) ,
29.1.3 by b11johgu
changed the order on the tables.
59
  INDEX `fk_StudentCourseRegistrations_Courses1_idx` (`courseID` ASC) ,
60
  CONSTRAINT `fk_StudentCourseRegistrations_Users`
61
    FOREIGN KEY (`userName` )
62
    REFERENCES `lenasys`.`Users` (`userName` )
63
    ON DELETE NO ACTION
64
    ON UPDATE NO ACTION,
65
  CONSTRAINT `fk_StudentCourseRegistrations_Courses1`
66
    FOREIGN KEY (`courseID` )
67
    REFERENCES `lenasys`.`Courses` (`courseID` )
68
    ON DELETE NO ACTION
69
    ON UPDATE NO ACTION)
70
ENGINE = InnoDB;
71
72
-- -----------------------------------------------------
73
-- Table `lenasys`.`Quizzes`
74
-- -----------------------------------------------------
75
CREATE  TABLE IF NOT EXISTS `lenasys`.`Quizzes` (
29.1.4 by b11johgu
changed the order of the attributes in the tables.
76
  `quizNr` INT NOT NULL ,
29.1.3 by b11johgu
changed the order on the tables.
77
  `courseID` VARCHAR(10) NOT NULL ,
78
  `quizData` VARCHAR(45) NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
79
  `allowMultipleReplies` BOOLEAN NULL , 
80
  `autoCorrected` BOOLEAN NULL , -- if the quiz is corrected by auto or if the teacher needs to do it manually.
81
  `openingDate` DATETIME NULL ,  -- time for the student to do the quiz
29.1.3 by b11johgu
changed the order on the tables.
82
  `closingDate` DATETIME NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
83
  PRIMARY KEY (`quizNr`, `courseID`) ,
29.1.3 by b11johgu
changed the order on the tables.
84
  INDEX `fk_Quizzes_Courses1_idx` (`courseID` ASC) ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
85
  UNIQUE INDEX `quizNr_UNIQUE` (`quizNr` ASC) ,
29.1.3 by b11johgu
changed the order on the tables.
86
  CONSTRAINT `fk_Quizzes_Courses1`
87
    FOREIGN KEY (`courseID` )
88
    REFERENCES `lenasys`.`Courses` (`courseID` )
89
    ON DELETE NO ACTION
90
    ON UPDATE NO ACTION)
91
ENGINE = InnoDB;
92
93
-- -----------------------------------------------------
94
-- Table `lenasys`.`QuizQuestions`
95
-- -----------------------------------------------------
96
CREATE  TABLE IF NOT EXISTS `lenasys`.`QuizQuestions` (
29.1.5 by b11johgu
corrected the order of tables/attributes further
97
  `questionID` INT NOT NULL , -- The id of the individual question in the quiz.
98
  `quizNr` INT NOT NULL , -- The quiz from wich the question is from
29.1.3 by b11johgu
changed the order on the tables.
99
  `courseID` VARCHAR(10) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
100
  `questionData` VARCHAR(45) NULL , -- the question
101
  `correctAnswer` VARCHAR(45) NULL , -- the answer
29.1.4 by b11johgu
changed the order of the attributes in the tables.
102
  PRIMARY KEY (`questionID`, `quizNr`, `courseID`) ,
103
  UNIQUE INDEX `questionID_UNIQUE` (`questionID` ASC) ,
104
  INDEX `fk_QuizQuestions_Quizzes1_idx` (`quizNr` ASC, `courseID` ASC) ,
29.1.3 by b11johgu
changed the order on the tables.
105
  CONSTRAINT `fk_QuizQuestions_Quizzes1`
29.1.4 by b11johgu
changed the order of the attributes in the tables.
106
    FOREIGN KEY (`quizNr` , `courseID` )
107
    REFERENCES `lenasys`.`Quizzes` (`quizNr` , `courseID` )
29.1.3 by b11johgu
changed the order on the tables.
108
    ON DELETE NO ACTION
109
    ON UPDATE NO ACTION)
110
ENGINE = InnoDB;
111
112
-- -----------------------------------------------------
113
-- Table `lenasys`.`AssignedQuizzes`
114
-- -----------------------------------------------------
115
CREATE  TABLE IF NOT EXISTS `lenasys`.`AssignedQuizzes` (
29.1.7 by b11johgu
fixed comments and an attribute
116
  `courseOccasion` VARCHAR(16) NOT NULL , -- Example HT2012 period 2
29.1.5 by b11johgu
corrected the order of tables/attributes further
117
  `userName` VARCHAR(20) NOT NULL , -- wich student took the quiz
29.1.3 by b11johgu
changed the order on the tables.
118
  `courseID` VARCHAR(10) NOT NULL ,
119
  `quizNr` INT NOT NULL ,
120
  `quizCourseID` VARCHAR(10) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
121
  `answers` VARCHAR(45) NULL , -- answers provided by the student
122
  `answerHash` VARCHAR(45) NULL , -- a security measure
123
  `answeredTimeStamp` DATETIME NULL , -- when the student submittet the quiz
29.1.3 by b11johgu
changed the order on the tables.
124
  `grade` VARCHAR(8) NULL ,
125
  `gradeComment` VARCHAR(200) NULL ,
32.1.2 by b11johgu
fixed a few bugs
126
  PRIMARY KEY (`userName`, `courseID`, `quizNr`, `quizCourseID`) ,
29.1.7 by b11johgu
fixed comments and an attribute
127
  INDEX `fk_AssignedQuizzes_Quizzes1_idx` (`quizNr` ASC, `courseID` ASC) ,
29.1.3 by b11johgu
changed the order on the tables.
128
  CONSTRAINT `fk_AssignedQuizzes_StudentCourseRegistrations1`
129
    FOREIGN KEY (`courseOccasion`,`userName` , `courseID` )
130
    REFERENCES `lenasys`.`StudentCourseRegistrations` (`courseOccasion`,`userName` , `courseID` )
131
    ON DELETE NO ACTION
132
    ON UPDATE NO ACTION,
133
  CONSTRAINT `fk_AssignedQuizzes_Quizzes1`
134
    FOREIGN KEY (`quizNr` , `quizCourseID` )
32.1.2 by b11johgu
fixed a few bugs
135
    REFERENCES `lenasys`.`Quizzes` (`quizNr` , `courseID` )
29.1.3 by b11johgu
changed the order on the tables.
136
    ON DELETE NO ACTION
137
    ON UPDATE NO ACTION)
138
ENGINE = InnoDB;
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
139
140
-- -----------------------------------------------------
141
-- Table `lenasys`.`Examples`
142
-- -----------------------------------------------------
143
CREATE  TABLE IF NOT EXISTS `lenasys`.`Examples` (
29.1.4 by b11johgu
changed the order of the attributes in the tables.
144
  `exampleName` VARCHAR(20) NOT NULL ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
145
  `courseID` VARCHAR(10) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
146
  `orderNumber` INT NULL , -- the order of the examples in the same category 
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
147
  `description` VARCHAR(200) NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
148
  PRIMARY KEY (`exampleName`, `courseID`) ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
149
  INDEX `fk_Examples_Courses1_idx` (`courseID` ASC) ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
150
  UNIQUE INDEX `exampleName_UNIQUE` (`exampleName` ASC) ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
151
  CONSTRAINT `fk_Examples_Courses1`
152
    FOREIGN KEY (`courseID` )
153
    REFERENCES `lenasys`.`Courses` (`courseID` )
154
    ON DELETE NO ACTION
155
    ON UPDATE NO ACTION)
156
ENGINE = InnoDB;
157
158
-- -----------------------------------------------------
159
-- Table `lenasys`.`Pages`
160
-- -----------------------------------------------------
161
CREATE  TABLE IF NOT EXISTS `lenasys`.`Pages` (
29.1.4 by b11johgu
changed the order of the attributes in the tables.
162
  `pageName` VARCHAR(45) NOT NULL ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
163
  `exampleName` VARCHAR(20) NOT NULL ,
164
  `courseID` VARCHAR(10) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
165
  `orderNumber` INT NULL , 
166
  `pageColumn` INT NOT NULL , -- which column in the view the file is presented
29.1.4 by b11johgu
changed the order of the attributes in the tables.
167
  PRIMARY KEY (`pageName`, `exampleName`, `courseID`) ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
168
  INDEX `fk_Pages_Examples1_idx` (`exampleName` ASC, `courseID` ASC) ,
169
  CONSTRAINT `fk_Pages_Examples1`
170
    FOREIGN KEY (`exampleName` , `courseID` )
29.1.4 by b11johgu
changed the order of the attributes in the tables.
171
    REFERENCES `lenasys`.`Examples` (`exampleName` , `courseID` )
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
172
    ON DELETE NO ACTION
173
    ON UPDATE NO ACTION)
174
ENGINE = InnoDB;
175
29.1.3 by b11johgu
changed the order on the tables.
176
-- -----------------------------------------------------
177
-- Table `lenasys`.`Files`
178
-- -----------------------------------------------------
179
CREATE  TABLE IF NOT EXISTS `lenasys`.`Files` (
180
  `fileName` VARCHAR(20) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
181
  `fileType` VARCHAR(5) NULL , -- can be for example: text, kod, video or bild
182
  `codeLanguage` VARCHAR(10) NULL , -- example: javascript, html, m.m.
29.1.6 by b11johgu
added comment
183
  `dataBlob` BLOB NULL , -- This is where the binary file is stored. Searchable.
29.1.3 by b11johgu
changed the order on the tables.
184
  PRIMARY KEY (`fileName`) ,
185
  UNIQUE INDEX `fileName_UNIQUE` (`fileName` ASC) )
186
ENGINE = InnoDB;
187
188
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
189
190
-- -----------------------------------------------------
29.1.4 by b11johgu
changed the order of the attributes in the tables.
191
-- Table `lenasys`.`PageFiles`
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
192
-- -----------------------------------------------------
29.1.4 by b11johgu
changed the order of the attributes in the tables.
193
CREATE  TABLE IF NOT EXISTS `lenasys`.`PageFiles` (
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
194
  `fileName` VARCHAR(20) NOT NULL ,
29.1.5 by b11johgu
corrected the order of tables/attributes further
195
  `pageName` VARCHAR(45) NOT NULL , -- 
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
196
  `exampleName` VARCHAR(20) NOT NULL ,
197
  `courseID` VARCHAR(10) NOT NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
198
  PRIMARY KEY (`fileName`, `pageName`, `exampleName`, `courseID`) ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
199
  INDEX `fk_PagesFiles_Files1_idx` (`fileName` ASC) ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
200
  INDEX `fk_PagesFiles_Pages1_idx` (`pageName` ASC, `exampleName` ASC, `courseID` ASC) ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
201
  CONSTRAINT `fk_PagesFiles_Files1`
202
    FOREIGN KEY (`fileName` )
203
    REFERENCES `lenasys`.`Files` (`fileName` )
204
    ON DELETE NO ACTION
205
    ON UPDATE NO ACTION,
206
  CONSTRAINT `fk_PagesFiles_Pages1`
29.1.4 by b11johgu
changed the order of the attributes in the tables.
207
    FOREIGN KEY (`pageName` , `exampleName` , `courseID` )
208
    REFERENCES `lenasys`.`Pages` (`pageName` , `exampleName` , `courseID` )
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
209
    ON DELETE NO ACTION
210
    ON UPDATE NO ACTION)
211
ENGINE = InnoDB;
212
213
214
-- -----------------------------------------------------
215
-- Table `lenasys`.`FileKeywords`
216
-- -----------------------------------------------------
217
CREATE  TABLE IF NOT EXISTS `lenasys`.`FileKeywords` (
218
  `id` INT NOT NULL AUTO_INCREMENT ,
219
  `fileName` VARCHAR(20) NOT NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
220
  `keyword` VARCHAR(20) NOT NULL ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
221
  PRIMARY KEY (`id`, `fileName`) ,
222
  INDEX `fk_FileKeywords_Files1_idx` (`fileName` ASC) ,
223
  UNIQUE INDEX `id_UNIQUE` (`id` ASC) ,
224
  CONSTRAINT `fk_FileKeywords_Files1`
225
    FOREIGN KEY (`fileName` )
226
    REFERENCES `lenasys`.`Files` (`fileName` )
227
    ON DELETE NO ACTION
228
    ON UPDATE NO ACTION)
229
ENGINE = InnoDB;
230
36.2.2 by Johan Gustavsson
changes places on a comment
231
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
232
-- -----------------------------------------------------
233
-- Table `lenasys`.`FileInterestingLines`
234
-- -----------------------------------------------------
235
CREATE  TABLE IF NOT EXISTS `lenasys`.`FileInterestingLines` (
236
  `id` INT NOT NULL AUTO_INCREMENT ,
237
  `fileName` VARCHAR(20) NOT NULL ,
29.1.4 by b11johgu
changed the order of the attributes in the tables.
238
  `beginAt` INT NULL ,
239
  `endAt` INT NULL ,
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
240
  PRIMARY KEY (`id`, `fileName`) ,
241
  INDEX `fk_FileInterestingLines_Files1_idx` (`fileName` ASC) ,
242
  UNIQUE INDEX `id_UNIQUE` (`id` ASC) ,
243
  CONSTRAINT `fk_FileInterestingLines_Files1`
244
    FOREIGN KEY (`fileName` )
245
    REFERENCES `lenasys`.`Files` (`fileName` )
246
    ON DELETE NO ACTION
247
    ON UPDATE NO ACTION)
248
ENGINE = InnoDB;
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
249
250
251
-- -----------------------------------------------------
252
-- Table `lenasys`.`logUsersQuizLogins`
253
-- -----------------------------------------------------
254
CREATE  TABLE IF NOT EXISTS `lenasys`.`logUsersQuizLogins` (
255
  `id` INT NOT NULL ,
256
  `userName` VARCHAR(20) NOT NULL ,
36.4.2 by b11johgu
Finished log-tables.
257
  `userAgent` VARCHAR(200) NOT NULL , -- web browser and version
258
  `userIP` VARCHAR(20) NOT NULL , --  ip-number
259
  `browserID` VARCHAR(64) /*NOT NULL*/ , -- autogenerated id for local-storage
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
260
  `courseID` VARCHAR(10) NOT NULL ,
261
  `courseOccasion` VARCHAR(16) NULL ,
262
  `quizNr` INT NOT NULL ,
263
  `loginTimeStamp` DATETIME NOT NULL ,
36.4.2 by b11johgu
Finished log-tables.
264
  `success` BOOLEAN NOT NULL ,
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
265
  PRIMARY KEY (`id`) ,
266
  UNIQUE INDEX `id_UNIQUE` (`id` ASC))
267
ENGINE = InnoDB;
268
-- -------------------------------------------------
269
-- Table `lenasys`.`logAssignedQuizzesAnswers`
270
-- -----------------------------------------------------
36.4.4 by b11johgu
Changed places on insert inty UserTypeCodes and Users
271
CREATE  TABLE IF NOT EXISTS `lenasys`.`logAssignedQuizzesAnswers` (
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
272
  `id` INT NOT NULL ,
273
  `userName` VARCHAR(20)  NOT NULL ,
36.4.2 by b11johgu
Finished log-tables.
274
  `userAgent` VARCHAR(200) NOT NULL ,
275
  `userIP` VARCHAR(20) NOT NULL ,
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
276
  `courseID` VARCHAR(10) NOT NULL ,
277
  `courseOccasion` VARCHAR(16) NOT NULL ,
278
  `quizNr` INT NOT NULL ,
279
  `answers` VARCHAR(45) NULL ,
280
  `answerHash` VARCHAR(45) NULL ,
36.4.2 by b11johgu
Finished log-tables.
281
  `answeredTimeStamp` DATETIME NULL  -- TIMESTAMP ??
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
282
  `grade` VARCHAR(8) NULL ,
283
  `gradeComment` VARCHAR(200) NULL ,
284
  PRIMARY KEY (`id`) ,
285
    UNIQUE INDEX `id_UNIQUE` (`id` ASC))
286
287
ENGINE = InnoDB;
288
-- -------------------------------------------------
289
-- Table `lenasys`.`logBenchmark`
290
-- -----------------------------------------------------
36.4.4 by b11johgu
Changed places on insert inty UserTypeCodes and Users
291
CREATE  TABLE IF NOT EXISTS `lenasys`.`logBenchmark` (
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
292
  `id` INT NOT NULL ,
293
  `userName` VARCHAR(20) NOT NULL ,
36.4.2 by b11johgu
Finished log-tables.
294
  `userAgent` VARCHAR(200) NOT NULL ,
295
  `userIP` VARCHAR(20)  NOT NULL ,
296
  `browser` VARCHAR(20)  NOT NULL , -- will they be used to show different views? Can we just use userAgent instead?
297
  `browserVersion` VARCHAR(20) NOT NULL , -- -||-
298
  `renderer` VARCHAR(20) NOT NULL , -- ??
299
  `rendererVersion` VARCHAR(20) NOT NULL , -- ??
300
  `os` VARCHAR(64) NOT NULL ,
301
  `osVersion` VARCHAR(20) NOT NULL ,
302
  `fps` VARCHAR(20) NOT NULL ,
303
  `maxFps` VARCHAR(20) NOT NULL ,
304
  `hostName` VARCHAR(20) NOT NULL , -- Ändrad till hostName
305
  `app` VARCHAR(20) NOT NULL ,
306
  `screenResolution` VARCHAR(20) NOT NULL ,
307
  `logTimeStamp` DATETIME NOT NULL ,
308
  `runtime` INT NOT NULL ,
36.4.1 by b11johgu
"finished" log-tables, just need further instructions about how
309
  PRIMARY KEY (`id`) ,
310
    UNIQUE INDEX `id_UNIQUE` (`id` ASC))
311
ENGINE = InnoDB;
36.2.1 by Johan Gustavsson
fixed bugg #1170270
312
-- -------------------------------------------------
36.4.4 by b11johgu
Changed places on insert inty UserTypeCodes and Users
313
  insert into `lenasys`.`UserTypeCodes` (`userTypeCode`,`userType`) 
314
  VALUES (0,'Teacher'),(1,'Student');
36.2.1 by Johan Gustavsson
fixed bugg #1170270
315
32.1.3 by b11johgu
fixed small bugs
316
insert into `lenasys`.`Users` (`userName`,`name`,`passwd`,`userType`,`ssn`) 
36.2.1 by Johan Gustavsson
fixed bugg #1170270
317
  VALUES ('sha1','Per Student',sha1('Syp9393'),1,'19900385-2345'),
318
  ('md5','Per Lärare',md5('Syp9393'),0,'19800385-2325');
319
  
36.4.4 by b11johgu
Changed places on insert inty UserTypeCodes and Users
320
36.2.1 by Johan Gustavsson
fixed bugg #1170270
321
322
-- -----------------------------------------------------
29.1.4 by b11johgu
changed the order of the attributes in the tables.
323
-- allow maximum of 5 succesfull quiz-attemps is a good begining for implementation of the loggingtables to add restriction. 
28.1.1 by b11johgu
added a new .sql to test alongside with the old.
324
SET SQL_MODE=@OLD_SQL_MODE;
325
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
29.1.7 by b11johgu
fixed comments and an attribute
326
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;