remove old readme
[atutor.git] / install / db / atutor_upgrade_1.6.4_to_2.0.sql
1
2
3 UPDATE `modules` SET `dir_name` = '_core/imscp' WHERE `modules`.`dir_name` = '_core/content_packaging' LIMIT 1 ;
4
5 INSERT INTO `modules` VALUES ('_core/modules', 2, 0, 8192, 0, 0);
6
7 # --------------------------------------------------------
8 # Adding feature of oauth client
9 # Table structure for table `oauth_client_servers`
10 # since 1.6.5
11
12 CREATE TABLE `oauth_client_servers` (
13   `oauth_server_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
14   `oauth_server` VARCHAR(255) NOT NULL default '',
15   `consumer_key` TEXT NOT NULL ,
16   `consumer_secret` TEXT NOT NULL ,
17   `expire_threshold` INT NOT NULL default 0,
18   `create_date` datetime NOT NULL,
19   PRIMARY KEY ( `oauth_server_id` ),
20   UNIQUE INDEX idx_consumer ( `oauth_server` )
21 ) ENGINE=MyISAM;
22
23 # --------------------------------------------------------
24 # Table structure for table `oauth_client_tokens`
25 # since 1.6.5
26
27 CREATE TABLE `oauth_client_tokens` (
28   `oauth_server_id` MEDIUMINT UNSIGNED NOT NULL,
29   `token` VARCHAR(50) NOT NULL default '',
30   `token_type` VARCHAR(50) NOT NULL NOT NULL default '',
31   `token_secret` TEXT NOT NULL,
32   `member_id` mediumint(8) unsigned NOT NULL ,
33   `assign_date` datetime NOT NULL,
34   PRIMARY KEY ( `oauth_server_id`, `token` )
35 ) ENGINE=MyISAM;
36
37 # END Adding feature of oauth client
38
39 # -------------- Photo Album Module Setup ----------------
40 INSERT INTO `modules` VALUES ('_standard/photos',        2, 16777216, 0, 0, 0);
41 # Photo Album Table
42 CREATE TABLE `pa_albums` (
43   `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
44   `name` VARCHAR(255) NOT NULL,
45   `location` VARCHAR(255) NOT NULL,
46   `description` TEXT NOT NULL,
47   `permission` TINYINT(1) UNSIGNED NOT NULL,
48   `member_id` INTEGER UNSIGNED NOT NULL,
49   `photo_id` INTEGER UNSIGNED NOT NULL,
50   `type_id` TINYINT(1) UNSIGNED NOT NULL,
51   `created_date` DATETIME NOT NULL,
52   `last_updated` DATETIME NOT NULL,
53   PRIMARY KEY (`id`)
54 )
55 ENGINE = MyISAM;
56
57 # Photos Table
58 CREATE TABLE `pa_photos` (
59   `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
60   `name` VARCHAR(255) NOT NULL,
61   `description` TEXT,
62   `alt_text` TEXT,
63   `member_id` INTEGER UNSIGNED NOT NULL,
64   `album_id` INTEGER UNSIGNED NOT NULL,
65   `ordering` SMALLINT UNSIGNED NOT NULL,
66   `created_date` DATETIME NOT NULL,
67   `last_updated` DATETIME NOT NULL,
68   PRIMARY KEY (`id`)
69 )
70 ENGINE = MyISAM;
71
72 # Course Album Table
73 CREATE TABLE `pa_course_album` (
74   `course_id` INTEGER UNSIGNED,
75   `album_id` INTEGER UNSIGNED,
76   PRIMARY KEY (`course_id`, `album_id`)
77 )
78 ENGINE = MyISAM;
79
80 # Photo Album Comments
81 CREATE TABLE `pa_album_comments` (
82   `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
83   `album_id` INTEGER UNSIGNED NOT NULL,
84   `member_id` INTEGER UNSIGNED NOT NULL,
85   `comment` TEXT NOT NULL,
86   `created_date` DATETIME NOT NULL,
87   PRIMARY KEY (`id`)
88 )
89 ENGINE = MyISAM;
90
91 # Photo Comments
92 CREATE TABLE `pa_photo_comments` (
93   `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
94   `photo_id` INTEGER UNSIGNED NOT NULL,
95   `member_id` INTEGER UNSIGNED NOT NULL,
96   `comment` TEXT NOT NULL,
97   `created_date` DATETIME NOT NULL,
98   PRIMARY KEY (`id`)
99 )
100 ENGINE = MyISAM;
101
102 # Initiali Config
103 INSERT INTO `config` VALUES ('pa_max_memory_per_member', '50');
104
105 # -------------- Photo Album Module Ends -----------------
106
107 # ----------------Flowplayer Module ------------------------
108 INSERT INTO `modules` VALUES ('_standard/flowplayer',    2, 33554432, 0, 0, 0);
109
110 # Add Transformable configuration
111
112 INSERT INTO `config` (`name`, `value`) VALUES('transformable_uri', 'http://localhost/transformable/');
113 INSERT INTO `config` (`name`, `value`) VALUES('transformable_web_service_id', '90c3cd6f656739969847f3a99ac0f3c7');
114 INSERT INTO `config` (`name`, `value`) VALUES('transformable_oauth_expire', '93600');
115
116 # End of adding Transformable configuration
117
118 # Add the 1.6 series default theme as a secondary theme for ATutor 2.0
119 INSERT INTO `themes` VALUES ('ATutor 1.6', '2.0', 'default16', NOW(), 'This is the 1.6 series default theme.', 1);
120
121 # Add new field themes.type to seperate "Desktop" and "Mobile" themes
122 ALTER TABLE `themes` ADD `type` varchar(20) NOT NULL default 'Desktop' AFTER `dir_name`;
123
124 # point the module index pages to the new locations
125 UPDATE `courses` SET main_links=replace(main_links, 'glossary/index.php', 'mods/_core/glossary/index.php'), home_links=replace(home_links, 'glossary/index.php', 'mods/_core/glossary/index.php');
126 UPDATE `courses` SET main_links=replace(main_links, 'file_storage/index.php', 'mods/_standard/file_storage/index.php'), home_links=replace(home_links, 'file_storage/index.php', 'mods/_standard/file_storage/index.php');
127 UPDATE `courses` SET main_links=replace(main_links, 'tile.php', 'mods/_standard/tile_search/tile.php'), home_links=replace(home_links, 'tile.php', 'mods/_standard/tile_search/tile.php');
128 UPDATE `courses` SET main_links=replace(main_links, 'forum/list.php', 'mods/_standard/forums/forum/list.php'), home_links=replace(home_links, 'forum/list.php', 'mods/_standard/forums/forum/list.php');
129 UPDATE `courses` SET main_links=replace(main_links, 'chat/index.php', 'mods/_standard/chat/index.php'), home_links=replace(home_links, 'chat/index.php', 'mods/_standard/chat/index.php');
130 UPDATE `courses` SET main_links=replace(main_links, 'faq/index.php', 'mods/_standard/faq/index.php'), home_links=replace(home_links, 'faq/index.php', 'mods/_standard/faq/index.php');
131 UPDATE `courses` SET main_links=replace(main_links, 'links/index.php', 'mods/_standard/links/index.php'), home_links=replace(home_links, 'links/index.php', 'mods/_standard/links/index.php');
132 UPDATE `courses` SET main_links=replace(main_links, 'tools/my_tests.php', 'mods/_standard/tests/my_tests.php'), home_links=replace(home_links, 'tools/my_tests.php', 'mods/_standard/tests/my_tests.php');
133 UPDATE `courses` SET main_links=replace(main_links, 'sitemap.php', 'mods/_standard/sitemap/sitemap.php'), home_links=replace(home_links, 'sitemap.php', 'mods/_standard/sitemap/sitemap.php');
134 UPDATE `courses` SET main_links=replace(main_links, 'export.php', 'mods/_core/imscp/export.php'), home_links=replace(home_links, 'export.php', 'mods/_core/imscp/export.php');
135 UPDATE `courses` SET main_links=replace(main_links, 'my_stats.php', 'mods/_standard/tracker/my_stats.php'), home_links=replace(home_links, 'my_stats.php', 'mods/_standard/tracker/my_stats.php');
136 UPDATE `courses` SET main_links=replace(main_links, 'polls/index.php', 'mods/_standard/polls/index.php'), home_links=replace(home_links, 'polls/index.php', 'mods/_standard/polls/index.php');
137 UPDATE `courses` SET main_links=replace(main_links, 'directory.php', 'mods/_standard/directory/directory.php'), home_links=replace(home_links, 'directory.php', 'mods/_standard/directory/directory.php');
138 UPDATE `courses` SET main_links=replace(main_links, 'groups.php', 'mods/_core/groups/groups.php'), home_links=replace(home_links, 'groups.php', 'mods/_core/groups/groups.php');
139 UPDATE `courses` SET main_links=replace(main_links, 'reading_list/index.php', 'mods/_standard/reading_list/index.php'), home_links=replace(home_links, 'reading_list/index.php', 'mods/_standard/reading_list/index.php');
140 UPDATE `courses` SET main_links=replace(main_links, 'blogs/index.php', 'mods/_standard/blogs/index.php'), home_links=replace(home_links, 'blogs/index.php', 'mods/_standard/blogs/index.php');
141 UPDATE `courses` SET main_links=replace(main_links, 'google_search/index.php', 'mods/_standard/google_search/index.php'), home_links=replace(home_links, 'google_search/index.php', 'mods/_standard/google_search/index.php');