remove old readme
[atutor.git] / install / db / atutor_upgrade_1.1_to_1.2.sql
1 ###############################################################
2 # Database upgrade SQL from ATutor 1.1-Stable to ATutor 1.2
3 ###############################################################
4
5 # delete the old phpMyChat tables
6 DROP TABLE `c_ban_users`;
7 DROP TABLE `c_messages` ;
8 DROP TABLE `c_reg_users`;
9 DROP TABLE `c_users`;
10
11 # --------------------------------------------------------
12
13 # empty the old g_refs and replace them with the new language enables ones
14
15 DELETE FROM `g_refs`;
16 INSERT INTO `g_refs` VALUES (1, 'g_users_online'),
17 (2, 'g_local_menu'),
18 (3, 'g_global_menu'),
19 (4, 'g_related_topic'),
20 (5, 'g_jump'),
21 (6, 'g_top_bypass'),
22 (7, 'g_sequence'),
23 (8, 'g_within_sitemap'),
24 (9, 'g_global_home'),
25 (10, 'g_breadcrumb'),
26 (11, 'g_headings'),
27 (12, 'g_embedded_links'),
28 (13, 'g_table_of_contents'),
29 (14, 'g_home'),
30 (15, 'g_tools'),
31 (16, 'g_resources'),
32 (17, 'g_discussions'),
33 (18, 'g_help'),
34 (19, 'g_logout'),
35 (20, 'g_preferences'),
36 (21, 'g_inbox'),
37 (22, 'g_local_major_topic'),
38 (23, 'g_to_sitemap'),
39 (24, 'g_embedded_glossary'),
40 (25, 'g_menu_glossary'),
41 (26, 'g_local_home'),
42 (27, 'g_print_compiler'),
43 (28, 'g_my_tracker'),
44 (29, 'g_links_db'),
45 (30, 'g_session_start'),
46 (31, 'g_chat'),
47 (32, 'g_mytests'),
48 (33, 'g_new_thread'),
49 (34, 'g_forum_reply'),
50 (35, 'g_view_thread');
51
52 ALTER TABLE `members` ADD `language` VARCHAR( 10 ) NOT NULL ;
53 ALTER TABLE `g_click_data` CHANGE `timestamp` `timestamp` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL;
54
55
56 #----------------------------------------------------------------
57
58 #create the language tables and insert the default English language
59
60 CREATE TABLE `lang2` (
61   `lang` char(3) NOT NULL default '',
62   `variable` varchar(30) NOT NULL default '',
63   `key` varchar(50) NOT NULL default '',
64   `text` text NOT NULL,
65   `revised_date` datetime NOT NULL default '0000-00-00 00:00:00',
66   PRIMARY KEY  (`lang`,`variable`,`key`),
67   KEY `lang_variable` (`lang`,`variable`)
68 ) TYPE=MyISAM;
69
70 CREATE TABLE `lang_base` (
71   `variable` varchar(30) NOT NULL default '',
72   `key` varchar(50) NOT NULL default '',
73   `text` text NOT NULL,
74   `revised_date` datetime NOT NULL default '0000-00-00 00:00:00',
75   `context` text NOT NULL,
76   PRIMARY KEY  (`variable`,`key`)
77 ) TYPE=MyISAM;
78
79 CREATE TABLE `lang_base_pages` (
80   `variable` varchar(30) NOT NULL default '',
81   `key` varchar(30) NOT NULL default '',
82   `page` varchar(50) NOT NULL default '',
83   PRIMARY KEY  (`variable`,`key`,`page`)
84 ) TYPE=MyISAM;
85
86
87 # --------------------------------------------------------
88
89 # replace the old learning concepts with the new language enabled one
90
91 DROP TABLE `learning_concepts`;
92
93 CREATE TABLE `learning_concepts` (
94   `course_id` mediumint(8) unsigned NOT NULL default '0',
95   `tag` varchar(20) NOT NULL default '',
96   PRIMARY KEY  (`tag`,`course_id`),
97   KEY `course_id` (`course_id`)
98 ) TYPE=MyISAM;
99
100 DELETE FROM `learning_concepts`;
101
102 INSERT INTO `learning_concepts` VALUES (0, 'discussion'),
103 (0, 'do'),
104 (0, 'dont'),
105 (0, 'important'),
106 (0, 'information'),
107 (0, 'link'),
108 (0, 'listen'),
109 (0, 'project'),
110 (0, 'question'),
111 (0, 'read'),
112 (0, 'test'),
113 (0, 'think'),
114 (0, 'write');
115 # --------------------------------------------------------
116
117 DELETE FROM `theme_settings`;
118
119 INSERT INTO `theme_settings` VALUES (1, 'accessibility', 'a:16:{s:19:"PREF_MAIN_MENU_SIDE";i:2;s:14:"PREF_MAIN_MENU";i:0;s:10:"PREF_THEME";i:0;s:12:"PREF_DISPLAY";i:0;s:9:"PREF_TIPS";i:0;s:8:"PREF_SEQ";i:1;s:8:"PREF_TOC";i:2;s:14:"PREF_NUMBERING";i:0;s:11:"PREF_ONLINE";i:0;s:14:"PREF_SEQ_ICONS";i:2;s:14:"PREF_NAV_ICONS";i:2;s:16:"PREF_LOGIN_ICONS";i:2;s:13:"PREF_HEADINGS";i:0;s:16:"PREF_BREADCRUMBS";i:0;s:9:"PREF_FONT";i:0;s:15:"PREF_STYLESHEET";i:0;}'),
120 (2, 'icons_only', 'a:4:{s:14:"PREF_SEQ_ICONS";i:1;s:14:"PREF_NAV_ICONS";i:1;s:16:"PREF_LOGIN_ICONS";i:1;s:16:"PREF_BREADCRUMBS";i:1;}'),
121 (3, 'both_icons_and_text', 'a:5:{s:14:"PREF_MAIN_MENU";i:1;s:14:"PREF_SEQ_ICONS";i:0;s:14:"PREF_NAV_ICONS";i:0;s:16:"PREF_LOGIN_ICONS";i:0;s:16:"PREF_BREADCRUMBS";i:1;}'),
122 (4, 'atutor_defaults', 'a:18:{s:10:"PREF_STACK";a:5:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;}s:19:"PREF_MAIN_MENU_SIDE";i:2;s:8:"PREF_SEQ";i:3;s:14:"PREF_NUMBERING";i:1;s:8:"PREF_TOC";i:1;s:14:"PREF_SEQ_ICONS";i:1;s:14:"PREF_NAV_ICONS";i:0;s:16:"PREF_LOGIN_ICONS";i:0;s:13:"PREF_HEADINGS";i:1;s:16:"PREF_BREADCRUMBS";i:1;s:9:"PREF_FONT";i:0;s:15:"PREF_STYLESHEET";i:0;s:9:"PREF_HELP";i:1;s:14:"PREF_MINI_HELP";i:1;s:18:"PREF_CONTENT_ICONS";i:0;s:14:"PREF_MAIN_MENU";i:1;s:11:"PREF_ONLINE";i:1;s:9:"PREF_MENU";i:1;}');
123 # --------------------------------------------------------
124
125 DROP TABLE users_online;
126
127 CREATE TABLE users_online (
128   member_id mediumint(8) unsigned NOT NULL default '0',
129   course_id mediumint(8) unsigned NOT NULL default '0',
130   login varchar(20) NOT NULL default '',
131   expiry int(10) unsigned NOT NULL default '0',
132   PRIMARY KEY  (member_id)
133 ) TYPE=HEAP MAX_ROWS=500;
134
135
136
137
138
139