remove old readme
[atutor.git] / install / db / atutor_upgrade_1.4.3_to_1.5.sql
1 ###############################################################\r
2 # Database upgrade SQL from ATutor 1.4.3 to ATutor 1.5\r
3 ###############################################################\r
4 \r
5 ALTER TABLE `courses` ADD `icon` VARCHAR( 20 ) NOT NULL , ADD `home_links` VARCHAR( 255 ) NOT NULL , ADD `main_links` VARCHAR( 255 ) NOT NULL , ADD `side_menu` VARCHAR( 255 ) NOT NULL;\r
6 \r
7 UPDATE `courses` SET home_links='forum/list.php|glossary/index.php|chat/index.php|tile.php|links/index.php|tools/my_tests.php|sitemap.php|export.php|my_stats.php|polls/index.php|directory.php';\r
8 UPDATE `courses` SET main_links='forum/list.php|glossary/index.php';\r
9 UPDATE `courses` SET side_menu ='menu_menu|related_topics|users_online|glossary|search|poll|posts';\r
10 \r
11 #fix for backup file names\r
12 ALTER TABLE `backups` CHANGE `file_name` `file_name` VARCHAR( 150 ) NOT NULL;\r
13 \r
14 \r
15 CREATE TABLE `member_track` (\r
16   `member_id` mediumint(8) unsigned NOT NULL default '0',\r
17   `course_id` mediumint(8) unsigned NOT NULL default '0',\r
18   `content_id` mediumint(8) unsigned NOT NULL default '0',\r
19   `counter` mediumint(8) unsigned NOT NULL default '0',\r
20   `duration` mediumint(8) unsigned NOT NULL default '0',\r
21   `last_accessed` datetime default NULL,\r
22   KEY `member_id` (`member_id`),\r
23   KEY `content_id` (`content_id`)\r
24 ) TYPE=MyISAM;\r
25 \r
26 \r
27 CREATE TABLE `admins` (\r
28    `login` VARCHAR( 30 ) NOT NULL ,\r
29    `password` VARCHAR( 30 ) NOT NULL ,\r
30    `real_name` VARCHAR( 30 ) NOT NULL ,\r
31    `email` VARCHAR( 50 ) NOT NULL ,\r
32    `language` varchar(5) NOT NULL default '',\r
33    `privileges` MEDIUMINT UNSIGNED NOT NULL ,\r
34    `last_login` DATETIME NOT NULL ,\r
35    PRIMARY KEY ( `login` )\r
36 );\r
37 \r
38 -- Table structure for table `admin_log`\r
39 \r
40 CREATE TABLE `admin_log` (\r
41   `login` varchar(30) NOT NULL default '',\r
42   `time` datetime NOT NULL default '0000-00-00 00:00:00',\r
43   `operation` varchar(20) NOT NULL default '',\r
44   `table` varchar(30) NOT NULL default '',\r
45   `num_affected` tinyint(3) NOT NULL default '0',\r
46   `details` varchar(255) NOT NULL default '',\r
47   KEY `login` (`login`)\r
48 ) TYPE=MyISAM;\r
49 \r
50 ALTER TABLE `courses` DROP `tracking` ;\r
51 \r
52 ALTER TABLE `members` ADD `inbox_notify` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL ;\r
53 ## instructors:\r
54 UPDATE `members` SET `status`=3 WHERE `status`=1;\r
55 ## students:\r
56 UPDATE `members` SET `status`=2 WHERE `status`=0;\r
57 \r
58 DROP TABLE `learning_concepts`;\r
59 DROP TABLE `theme_settings`;\r
60 \r
61 ALTER TABLE `courses` CHANGE `primary_language` `primary_language` VARCHAR( 5 ) NOT NULL;\r
62 ALTER TABLE `members` CHANGE `language` `language` VARCHAR( 5 ) NOT NULL;\r
63 \r
64 UPDATE `themes` SET status=0;\r
65 ALTER TABLE `themes` CHANGE `extra_info` `extra_info` VARCHAR( 255 ) NOT NULL;\r
66 REPLACE INTO `themes` VALUES ('ATutor', '1.5', 'default', NOW(), 'This is the default ATutor theme and cannot be deleted as other themes inherit from it. Please do not alter this theme directly as it would complicate upgrading. Instead, create a new theme derived from this one.', 2);\r
67 \r
68 REPLACE INTO `themes` VALUES ('ATutor Classic', '1.5', 'default_classic', NOW(), 'This is the ATutor Classic theme which makes use of the custom Header and logo images. To customize those images you must edit the <code>theme.cfg.php</code> in this theme\'s directory.', 1);\r
69 \r
70 \r
71 ALTER TABLE `messages` ADD `course_id` MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `message_id` ;\r
72 \r
73 \r
74 # Table structure for table `master_list`\r
75 CREATE TABLE `master_list` (\r
76   `public_field` CHAR( 30 ) NOT NULL ,\r
77   `hash_field` CHAR( 40 ) NOT NULL ,\r
78   `member_id` MEDIUMINT UNSIGNED NOT NULL 0,\r
79   PRIMARY KEY ( `public_field` )\r
80 );\r