remove old readme
[atutor.git] / install / db / atutor_upgrade_1.5.3.3_to_1.5.4.sql
1 ###############################################################
2 # Database upgrade SQL from ATutor 1.5.3.3 to ATutor 1.5.4
3 ###############################################################
4
5 ## alter the test questions table to support matching type questions
6
7 ALTER TABLE `tests_questions` ADD `option_0` VARCHAR( 255 ) NOT NULL AFTER `answer_9` ,
8 ADD `option_1` VARCHAR( 255 ) NOT NULL AFTER `option_0` ,
9 ADD `option_2` VARCHAR( 255 ) NOT NULL AFTER `option_1` ,
10 ADD `option_3` VARCHAR( 255 ) NOT NULL AFTER `option_2` ,
11 ADD `option_4` VARCHAR( 255 ) NOT NULL AFTER `option_3` ,
12 ADD `option_5` VARCHAR( 255 ) NOT NULL AFTER `option_4` ,
13 ADD `option_6` VARCHAR( 255 ) NOT NULL AFTER `option_5` ,
14 ADD `option_7` VARCHAR( 255 ) NOT NULL AFTER `option_6` ,
15 ADD `option_8` VARCHAR( 255 ) NOT NULL AFTER `option_7` ,
16 ADD `option_9` VARCHAR( 255 ) NOT NULL AFTER `option_8` ;
17
18 ## alter the tests table to support guest tests
19 ALTER TABLE `tests` ADD `guests` TINYINT NOT NULL DEFAULT '0';
20
21 # --------------------------------------------------------
22 # Table structure for table `course_access`
23
24 CREATE TABLE `course_access` (
25   `password` char(8) NOT NULL ,
26   `course_id` mediumint(8) unsigned NOT NULL ,
27   `expiry_date` timestamp NOT NULL ,
28   `enabled` tinyint(4) NOT NULL ,
29   PRIMARY KEY ( `password` ) ,
30   UNIQUE (`course_id`)
31 ) ENGINE=MyISAM ;
32
33 ## alter the members table to support last login
34 ALTER TABLE `members` ADD `last_login` TIMESTAMP NOT NULL ;
35
36 ## alter the forums table to support minutes to edit
37 ALTER TABLE `forums` ADD `mins_to_edit` SMALLINT UNSIGNED NOT NULL DEFAULT '0';
38
39 ## table for saving sent inbox messages
40 CREATE TABLE `messages_sent` (
41    `message_id` mediumint( 8 ) unsigned NOT NULL AUTO_INCREMENT ,
42    `course_id` mediumint( 8 ) unsigned NOT NULL default '0',
43    `from_member_id` mediumint( 8 ) unsigned NOT NULL default '0',
44    `to_member_id` mediumint( 8 ) unsigned NOT NULL default '0',
45    `date_sent` timestamp NOT NULL ,
46    `subject` varchar( 150 ) NOT NULL default '',
47    `body` text NOT NULL ,
48    PRIMARY KEY ( `message_id` ) ,
49    KEY `from_member_id` ( `from_member_id` )
50 ) ENGINE =MYISAM;
51
52 ## add the profile_pictures module
53 INSERT INTO `modules` VALUES ('_standard/profile_pictures', 2, 0, 0, 0, 0);
54
55 ## remove inherit_release_date field
56 ALTER TABLE `content` DROP `inherit_release_date`;