1 ###############################################################
2 # Database upgrade SQL from ATutor 1.1-Stable to ATutor 1.2
3 ###############################################################
5 # delete the old phpMyChat tables
6 DROP TABLE `c_ban_users`;
7 DROP TABLE `c_messages` ;
8 DROP TABLE `c_reg_users`;
11 # --------------------------------------------------------
13 # empty the old g_refs and replace them with the new language enables ones
16 INSERT INTO `g_refs` VALUES (1, 'g_users_online'),
19 (4, 'g_related_topic'),
23 (8, 'g_within_sitemap'),
27 (12, 'g_embedded_links'),
28 (13, 'g_table_of_contents'),
32 (17, 'g_discussions'),
35 (20, 'g_preferences'),
37 (22, 'g_local_major_topic'),
39 (24, 'g_embedded_glossary'),
40 (25, 'g_menu_glossary'),
42 (27, 'g_print_compiler'),
45 (30, 'g_session_start'),
49 (34, 'g_forum_reply'),
50 (35, 'g_view_thread');
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;
56 #----------------------------------------------------------------
58 #create the language tables and insert the default English language
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 '',
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`)
70 CREATE TABLE `lang_base` (
71 `variable` varchar(30) NOT NULL default '',
72 `key` varchar(50) NOT NULL default '',
74 `revised_date` datetime NOT NULL default '0000-00-00 00:00:00',
75 `context` text NOT NULL,
76 PRIMARY KEY (`variable`,`key`)
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`)
87 # --------------------------------------------------------
89 # replace the old learning concepts with the new language enabled one
91 DROP TABLE `learning_concepts`;
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`)
100 DELETE FROM `learning_concepts`;
102 INSERT INTO `learning_concepts` VALUES (0, 'discussion'),
115 # --------------------------------------------------------
117 DELETE FROM `theme_settings`;
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 # --------------------------------------------------------
125 DROP TABLE users_online;
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;