Completed
Push — 1.10.x ( 2635b5...f0080b )
by Yannick
165:55 queued 120:08
created

Version110   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 591
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 2 Features 0
Metric Value
c 2
b 2
f 0
dl 0
loc 591
rs 10
wmc 14
lcom 0
cbo 4
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Application\Migrations\Schema\V110;
5
6
use Application\Migrations\AbstractMigrationChamilo;
7
use Doctrine\DBAL\Schema\Schema;
8
use \Doctrine\DBAL\Types\Type;
9
10
/**
11
 * Class Version110
12
 *
13
 * Migrate file to updated to Chamilo 1.10
14
 *
15
 * @package Application\Migrations\Schema\V110
16
 */
17
class Version110 extends AbstractMigrationChamilo
18
{
19
    /**
20
     * @param Schema $schema
21
     */
22
    public function preUp(Schema $schema)
23
    {
24
        $this->addSql("ALTER TABLE session_rel_course ENGINE=InnoDB");
25
        $this->addSql("ALTER TABLE session_rel_course_rel_user ENGINE=InnoDB");
26
        $this->addSql("ALTER TABLE session_rel_user ENGINE=InnoDB");
27
        $this->addSql("UPDATE session SET session.id_coach = 1 WHERE id_coach NOT IN ( SELECT user_id FROM user)");
28
    }
29
30
    /**
31
     * @param Schema $schema
32
     *
33
     * @throws \Doctrine\DBAL\Schema\SchemaException
34
     */
35
    public function up(Schema $schema)
36
    {
37
        // Use $schema->createTable
38
        $this->addSql('set sql_mode=""');
39
40
        $this->addSql("CREATE TABLE IF NOT EXISTS course_field_options (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, field_id INT NOT NULL, option_value TEXT, option_display_text VARCHAR(64), option_order INT, tms DATETIME)");
41
        $this->addSql("CREATE TABLE IF NOT EXISTS session_field_options (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, field_id INT NOT NULL, option_value TEXT, option_display_text VARCHAR(64), option_order INT, tms DATETIME)");
42
        $this->addSql("CREATE TABLE IF NOT EXISTS hook_observer( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, path varchar(255) NOT NULL, plugin_name varchar(255) NULL, PRIMARY KEY PK_hook_management_hook_observer(id))");
43
        $this->addSql("CREATE TABLE IF NOT EXISTS hook_event( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, description varchar(255), PRIMARY KEY PK_hook_management_hook_event(id))");
44
        $this->addSql("CREATE TABLE IF NOT EXISTS hook_call( id int UNSIGNED NOT NULL AUTO_INCREMENT, hook_event_id int UNSIGNED NOT NULL, hook_observer_id int UNSIGNED NOT NULL, type tinyint NOT NULL, hook_order int UNSIGNED NOT NULL, enabled tinyint NOT NULL, PRIMARY KEY PK_hook_management_hook_call(id))");
45
        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (iid INT NOT NULL PRIMARY KEY, id INT NULL, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL)");
46
        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_rel_user (iid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, id INT NULL, work_id INT NOT NULL, user_id INT NOT NULL, c_id INT NOT NULL)");
47
        $this->addSql("CREATE TABLE IF NOT EXISTS c_student_publication_comment (iid INT NOT NULL PRIMARY KEY, id INT NULL, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL)");
48
        $this->addSql("CREATE TABLE IF NOT EXISTS c_attendance_calendar_rel_group (iid int NOT NULL auto_increment PRIMARY KEY, id INT, c_id INT NOT NULL, group_id INT NOT NULL, calendar_id INT NOT NULL)");
49
50
        $this->addSql("ALTER TABLE session MODIFY COLUMN date_start date default NULL, MODIFY COLUMN date_end date default NULL");
51
        $this->addSql("ALTER TABLE skill_rel_user MODIFY COLUMN acquired_skill_at datetime default NULL");
52
        $this->addSql("ALTER TABLE track_e_access MODIFY COLUMN access_date datetime DEFAULT NULL");
53
        $this->addSql("ALTER TABLE track_e_lastaccess MODIFY COLUMN access_date datetime DEFAULT NULL");
54
55
        $table = $schema->getTable('skill_rel_user');
56
57
        if (!$table->hasColumn('course_id')) {
58
            $this->addSql("ALTER TABLE skill_rel_user ADD COLUMN course_id INT NOT NULL DEFAULT 0 AFTER id");
59
        }
60
61
        if (!$table->hasColumn('session_id')) {
62
            $this->addSql("ALTER TABLE skill_rel_user ADD COLUMN session_id INT NOT NULL DEFAULT 0 AFTER course_id");
63
        }
64
65
        $this->addSql("ALTER TABLE skill_rel_user ADD INDEX idx_select_cs (course_id, session_id)");
66
67
        // Delete info of session_rel_user if session does not exists;
68
        $this->addSql("DELETE FROM session_rel_user WHERE id_session NOT IN (SELECT id FROM session)");
69
70
        // Delete info of usergroup_rel_user if usergroup does not exists;
71
        $this->addSql("DELETE FROM usergroup_rel_user WHERE usergroup_id NOT IN (SELECT id FROM usergroup)");
72
73
        $session = $schema->getTable('session');
74
        $session->getColumn('id')->setType(Type::getType(Type::INTEGER))->setUnsigned(false);
75
        if (!$session->hasColumn('description')) {
76
            $session->addColumn(
77
                'description',
78
                'text'
79
            );
80
        }
81
82
        if (!$session->hasColumn('show_description')) {
83
            $session->addColumn(
84
                'show_description',
85
                'smallint',
86
                array('default' => 0, 'unsigned' => true)
87
            );
88
        }
89
90
        $sessionTable = $schema->getTable('session');
91
        if (!$sessionTable->hasColumn('duration')) {
92
            $this->addSql("ALTER TABLE session ADD COLUMN duration int");
93
        }
94
95
        $sessionRelUser = $schema->getTable('session_rel_user');
96
        if (!$sessionRelUser->hasColumn('duration')) {
97
            $this->addSql("ALTER TABLE session_rel_user ADD COLUMN duration int");
98
        }
99
100
        $this->addSql("ALTER TABLE skill ADD COLUMN criteria text");
101
        $this->addSql("ALTER TABLE gradebook_category ADD COLUMN generate_certificates TINYINT NOT NULL DEFAULT 0");
102
        $this->addSql("ALTER TABLE track_e_access ADD COLUMN c_id int NOT NULL");
103
104
        $this->addSql("ALTER TABLE track_e_lastaccess ADD COLUMN c_id int NOT NULL");
105
        $this->addSql("ALTER TABLE track_e_exercices ADD COLUMN c_id int NOT NULL");
106
        $this->addSql("ALTER TABLE track_e_downloads ADD COLUMN c_id int NOT NULL");
107
        $this->addSql("ALTER TABLE track_e_hotpotatoes ADD COLUMN c_id int NOT NULL");
108
        $this->addSql("ALTER TABLE track_e_links ADD COLUMN c_id int NOT NULL");
109
        $this->addSql("ALTER TABLE track_e_course_access ADD COLUMN c_id int NOT NULL");
110
        $this->addSql("ALTER TABLE track_e_online ADD COLUMN c_id int NOT NULL");
111
        $this->addSql("ALTER TABLE track_e_attempt ADD COLUMN c_id int NOT NULL");
112
        $table = $schema->getTable('track_e_default');
113
        if (!$table->hasColumn('session_id')) {
114
            $this->addSql("ALTER TABLE track_e_default ADD COLUMN session_id int NOT NULL");
115
        }
116
117
        if (!$table->hasColumn('c_id')) {
118
            $this->addSql("ALTER TABLE track_e_default ADD COLUMN c_id int NOT NULL");
119
        }
120
121
        $this->addSql("ALTER TABLE track_e_access ADD COLUMN user_ip varchar(39) NOT NULL default ''");
122
        $this->addSql("ALTER TABLE track_e_exercices ADD COLUMN user_ip varchar(39) NOT NULL default ''");
123
        $this->addSql("ALTER TABLE track_e_course_access ADD COLUMN user_ip varchar(39) NOT NULL default ''");
124
        $this->addSql("ALTER TABLE track_e_online CHANGE COLUMN login_ip user_ip varchar(39) NOT NULL DEFAULT ''");
125
        $this->addSql("ALTER TABLE track_e_login CHANGE COLUMN login_ip user_ip varchar(39) NOT NULL DEFAULT ''");
126
127
		$this->addSql("ALTER TABLE user MODIFY COLUMN user_id int unsigned NOT NULL");
128
        $this->addSql("ALTER TABLE user DROP PRIMARY KEY");
129
        $this->addSql("ALTER TABLE user MODIFY COLUMN user_id int unsigned DEFAULT NULL");
130
        $this->addSql("ALTER TABLE user ADD COLUMN id INT DEFAULT NULL");
131
        $this->addSql("UPDATE user SET id = user_id");
132
        $this->addSql("ALTER TABLE user MODIFY COLUMN id INT NOT NULL PRIMARY KEY AUTO_INCREMENT AFTER user_id");
133
134
        $this->addSql("ALTER TABLE user MODIFY COLUMN chatcall_date datetime default NULL");
135
        $this->addSql("ALTER TABLE user MODIFY COLUMN chatcall_text varchar(50) default NULL");
136
        $this->addSql("ALTER TABLE user MODIFY COLUMN chatcall_user_id int unsigned default 0");
137
        $this->addSql("ALTER TABLE user MODIFY COLUMN expiration_date datetime default NULL");
138
        $this->addSql("ALTER TABLE user MODIFY COLUMN registration_date datetime NOT NULL");
139
140
        $this->addSql("ALTER TABLE course ADD COLUMN add_teachers_to_sessions_courses tinyint NOT NULL default 0");
141
        $this->addSql("ALTER TABLE course DROP COLUMN target_course_code");
142
        $this->addSql("ALTER TABLE session MODIFY COLUMN name char(100) NOT NULL DEFAULT ''");
143
        $this->addSql("ALTER TABLE course_rel_user ADD COLUMN c_id int default NULL");
144
        $this->addSql("ALTER TABLE course_field_values ADD COLUMN c_id int default NULL");
145
146
        $this->addSql("ALTER TABLE session_rel_course_rel_user ADD COLUMN c_id int default NULL");
147
        $this->addSql("ALTER TABLE session_rel_course_rel_user CHANGE id_session session_id int");
148
        $this->addSql("ALTER TABLE session_rel_course_rel_user CHANGE id_user user_id int");
149
150
        $this->addSql("ALTER TABLE access_url_rel_course ADD COLUMN c_id int");
151
152
        $this->addSql("ALTER TABLE session_rel_course ADD COLUMN position int NOT NULL default 0");
153
        $this->addSql("ALTER TABLE session_rel_course ADD COLUMN category varchar(255) default ''");
154
        $this->addSql("ALTER TABLE session_rel_course ADD COLUMN c_id int unsigned");
155
        $this->addSql("ALTER TABLE session_rel_course CHANGE id_session session_id int");
156
157
        $this->addSql("UPDATE course_rel_user SET c_id = (SELECT id FROM course WHERE code = course_code)");
158
159
        // Add iid
160
        $tables = [
161
            'c_announcement',
162
            'c_announcement_attachment',
163
            'c_attendance',
164
            'c_attendance_calendar',
165
            //'c_attendance_calendar_rel_group',
166
            'c_attendance_result',
167
            //'c_attendance_sheet',
168
            'c_attendance_sheet_log',
169
            //'c_blog',
170
            'c_blog_attachment',
171
            //'c_blog_comment',
172
            //'c_blog_post',
173
            //'c_blog_rating',
174
            //'c_blog_rel_user',
175
            //'c_blog_task',
176
            //'c_blog_task_rel_user',
177
            'c_calendar_event',
178
            'c_calendar_event_attachment',
179
            //'c_calendar_event_repeat',
180
            //'c_calendar_event_repeat_not',
181
            'c_chat_connected',
182
            'c_course_description',
183
            'c_course_setting',
184
            'c_document',
185
            //'c_dropbox_category',
186
            //'c_dropbox_feedback',
187
            'c_dropbox_file',
188
            //'c_dropbox_person',
189
            //'c_dropbox_post',
190
            'c_forum_attachment',
191
            //'c_forum_category',
192
            //'c_forum_forum',
193
            'c_forum_mailcue',
194
            'c_forum_notification',
195
            //'c_forum_post',
196
            //'c_forum_thread',
197
            'c_forum_thread_qualify',
198
            'c_forum_thread_qualify_log',
199
            //'c_glossary',
200
            'c_group_category',
201
            'c_group_info',
202
            'c_group_rel_tutor',
203
            'c_group_rel_user',
204
            'c_item_property',
205
            'c_link',
206
            'c_link_category',
207
            'c_lp',
208
            'c_lp_item',
209
            'c_lp_item_view',
210
            'c_lp_iv_interaction',
211
            'c_lp_iv_objective',
212
            'c_lp_view',
213
            //'c_notebook',
214
            //'c_online_connected',
215
            'c_online_link',
216
            'c_permission_group',
217
            'c_permission_task',
218
            'c_permission_user',
219
            'c_quiz',
220
            //'c_quiz_answer',
221
            'c_quiz_question',
222
            'c_quiz_question_category',
223
            'c_quiz_question_option',
224
            //'c_quiz_question_rel_category',
225
            //'c_quiz_rel_question',
226
            'c_resource',
227
            //'c_role',
228
            'c_role_group',
229
            'c_role_permissions',
230
            //'c_role_user',
231
            'c_student_publication',
232
            'c_student_publication_assignment',
233
            //'c_student_publication_comment',
234
            //'c_student_publication_rel_document',
235
            //'c_student_publication_rel_user',
236
            //'c_survey',
237
            //'c_survey_answer',
238
            'c_survey_group',
239
            //'c_survey_invitation',
240
            //'c_survey_question',
241
            //'c_survey_question_option',
242
            'c_thematic',
243
            'c_thematic_advance',
244
            'c_thematic_plan',
245
            'c_tool',
246
            //'c_tool_intro',
247
            'c_userinfo_content',
248
            'c_userinfo_def',
249
            'c_wiki',
250
            //'c_wiki_conf',
251
            'c_wiki_discuss',
252
            'c_wiki_mailcue'
253
        ];
254
255
        foreach ($tables as $table) {
256
            if ($schema->hasTable($table)) {
257
                $this->addSql("ALTER TABLE $table MODIFY COLUMN id INT NOT NULL");
258
                $this->addSql("ALTER TABLE $table MODIFY COLUMN c_id INT NOT NULL");
259
                $this->addSql("ALTER TABLE $table DROP PRIMARY KEY");
260
                $this->addSql("ALTER TABLE $table MODIFY COLUMN id INT NULL");
261
                $this->addSql("ALTER TABLE $table ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
262
            }
263
        }
264
265
        if ($schema->hasTable('c_attendance_calendar_rel_group')) {
266
            $this->addSql("ALTER TABLE c_attendance_calendar_rel_group MODIFY COLUMN id INT NOT NULL");
267
            $this->addSql("ALTER TABLE c_attendance_calendar_rel_group DROP PRIMARY KEY");
268
            $this->addSql("ALTER TABLE c_attendance_calendar_rel_group MODIFY COLUMN id INT NULL DEFAULT NULL");
269
            $this->addSql("ALTER TABLE c_attendance_calendar_rel_group ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
270
        }
271
272
        $this->addSql("ALTER TABLE c_attendance_sheet MODIFY COLUMN c_id INT NOT NULL");
273
        $this->addSql("ALTER TABLE c_attendance_sheet DROP PRIMARY KEY");
274
        $this->addSql("ALTER TABLE c_attendance_sheet ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
275
276
        $this->addSql("ALTER TABLE c_blog MODIFY COLUMN blog_id int unsigned NOT NULL");
277
        $this->addSql("ALTER TABLE c_blog MODIFY COLUMN c_id INT NOT NULL");
278
        $this->addSql("ALTER TABLE c_blog DROP PRIMARY KEY");
279
        $this->addSql("ALTER TABLE c_blog MODIFY COLUMN blog_id int unsigned DEFAULT NULL");
280
        $this->addSql("ALTER TABLE c_blog ADD COLUMN iid int  NOT NULL PRIMARY KEY AUTO_INCREMENT");
281
282
        $this->addSql("ALTER TABLE c_blog_comment MODIFY COLUMN comment_id int NOT NULL");
283
        $this->addSql("ALTER TABLE c_blog_comment MODIFY COLUMN c_id INT NOT NULL");
284
        $this->addSql("ALTER TABLE c_blog_comment DROP PRIMARY KEY");
285
        $this->addSql("ALTER TABLE c_blog_comment MODIFY COLUMN comment_id int DEFAULT NULL");
286
        $this->addSql("ALTER TABLE c_blog_comment ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
287
288
        $this->addSql("ALTER TABLE c_blog_post MODIFY COLUMN post_id int unsigned NOT NULL");
289
        $this->addSql("ALTER TABLE c_blog_post MODIFY COLUMN c_id INT NOT NULL");
290
        $this->addSql("ALTER TABLE c_blog_post DROP PRIMARY KEY");
291
        $this->addSql("ALTER TABLE c_blog_post MODIFY COLUMN post_id int unsigned DEFAULT NULL");
292
        $this->addSql("ALTER TABLE c_blog_post ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
293
294
        $this->addSql("ALTER TABLE c_blog_rating MODIFY COLUMN rating_id int unsigned NOT NULL");
295
        $this->addSql("ALTER TABLE c_blog_rating MODIFY COLUMN c_id INT NOT NULL");
296
        $this->addSql("ALTER TABLE c_blog_rating DROP PRIMARY KEY");
297
        $this->addSql("ALTER TABLE c_blog_rating MODIFY COLUMN rating_id int unsigned DEFAULT NULL");
298
        $this->addSql("ALTER TABLE c_blog_rating ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
299
300
        $this->addSql("ALTER TABLE c_blog_rel_user DROP PRIMARY KEY");
301
        $this->addSql("ALTER TABLE c_blog_rel_user MODIFY COLUMN c_id INT NOT NULL");
302
        $this->addSql("ALTER TABLE c_blog_rel_user MODIFY COLUMN blog_id int unsigned DEFAULT NULL");
303
        $this->addSql("ALTER TABLE c_blog_rel_user MODIFY COLUMN user_id int unsigned DEFAULT NULL");
304
        $this->addSql("ALTER TABLE c_blog_rel_user ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
305
306
        $this->addSql("ALTER TABLE c_blog_task MODIFY COLUMN task_id int unsigned NOT NULL");
307
        $this->addSql("ALTER TABLE c_blog_task MODIFY COLUMN c_id INT NOT NULL");
308
        $this->addSql("ALTER TABLE c_blog_task DROP PRIMARY KEY");
309
        $this->addSql("ALTER TABLE c_blog_task MODIFY COLUMN task_id int unsigned DEFAULT NULL");
310
        $this->addSql("ALTER TABLE c_blog_task ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
311
312
        $this->addSql("ALTER TABLE c_blog_task_rel_user DROP PRIMARY KEY");
313
        $this->addSql("ALTER TABLE c_blog_task_rel_user MODIFY COLUMN blog_id int unsigned DEFAULT NULL");
314
        $this->addSql("ALTER TABLE c_blog_task_rel_user MODIFY COLUMN user_id int unsigned DEFAULT NULL");
315
        $this->addSql("ALTER TABLE c_blog_task_rel_user MODIFY COLUMN task_id int unsigned DEFAULT NULL");
316
        $this->addSql("ALTER TABLE c_blog_task_rel_user ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
317
318
        $this->addSql("ALTER TABLE c_calendar_event_repeat DROP PRIMARY KEY");
319
        $this->addSql("ALTER TABLE c_calendar_event_repeat MODIFY COLUMN cal_id int unsigned DEFAULT NULL");
320
        $this->addSql("ALTER TABLE c_calendar_event_repeat MODIFY COLUMN c_id INT NOT NULL");
321
        $this->addSql("ALTER TABLE c_calendar_event_repeat ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
322
323
        $this->addSql("ALTER TABLE c_calendar_event_repeat_not DROP PRIMARY KEY");
324
        $this->addSql("ALTER TABLE c_calendar_event_repeat_not MODIFY COLUMN cal_id int unsigned DEFAULT NULL");
325
        $this->addSql("ALTER TABLE c_calendar_event_repeat_not MODIFY COLUMN c_id INT NOT NULL");
326
        $this->addSql("ALTER TABLE c_calendar_event_repeat_not ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
327
328
        $this->addSql("ALTER TABLE c_dropbox_category MODIFY COLUMN cat_id int unsigned NOT NULL");
329
        $this->addSql("ALTER TABLE c_dropbox_category DROP PRIMARY KEY");
330
        $this->addSql("ALTER TABLE c_dropbox_category MODIFY COLUMN cat_id int unsigned DEFAULT NULL");
331
        $this->addSql("ALTER TABLE c_dropbox_category MODIFY COLUMN c_id INT NOT NULL");
332
        $this->addSql("ALTER TABLE c_dropbox_category ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
333
334
        $this->addSql("ALTER TABLE c_dropbox_feedback MODIFY COLUMN feedback_id int unsigned NOT NULL");
335
        $this->addSql("ALTER TABLE c_dropbox_feedback DROP PRIMARY KEY");
336
        $this->addSql("ALTER TABLE c_dropbox_feedback MODIFY COLUMN feedback_id int unsigned DEFAULT NULL");
337
        $this->addSql("ALTER TABLE c_dropbox_feedback MODIFY COLUMN c_id INT NOT NULL");
338
        $this->addSql("ALTER TABLE c_dropbox_feedback ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
339
340
        $this->addSql("ALTER TABLE c_dropbox_person DROP PRIMARY KEY");
341
        $this->addSql("ALTER TABLE c_dropbox_person MODIFY COLUMN file_id int unsigned DEFAULT NULL");
342
        $this->addSql("ALTER TABLE c_dropbox_person MODIFY COLUMN c_id INT NOT NULL");
343
        $this->addSql("ALTER TABLE c_dropbox_person ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
344
345
        $this->addSql("ALTER TABLE c_dropbox_post DROP PRIMARY KEY");
346
        $this->addSql("ALTER TABLE c_dropbox_post MODIFY COLUMN file_id int unsigned DEFAULT NULL");
347
        $this->addSql("ALTER TABLE c_dropbox_post MODIFY COLUMN c_id INT NOT NULL");
348
        $this->addSql("ALTER TABLE c_dropbox_post ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
349
350
        $this->addSql("ALTER TABLE c_forum_category MODIFY COLUMN cat_id int unsigned NOT NULL");
351
        $this->addSql("ALTER TABLE c_forum_category DROP PRIMARY KEY");
352
        $this->addSql("ALTER TABLE c_forum_category MODIFY COLUMN cat_id int unsigned DEFAULT NULL");
353
        $this->addSql("ALTER TABLE c_forum_category MODIFY COLUMN c_id INT NOT NULL");
354
        $this->addSql("ALTER TABLE c_forum_category ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
355
356
        $this->addSql("ALTER TABLE c_forum_forum MODIFY COLUMN forum_id int unsigned NOT NULL");
357
        $this->addSql("ALTER TABLE c_forum_forum DROP PRIMARY KEY");
358
        $this->addSql("ALTER TABLE c_forum_forum MODIFY COLUMN forum_id int unsigned DEFAULT NULL");
359
        $this->addSql("ALTER TABLE c_forum_forum MODIFY COLUMN c_id INT NOT NULL");
360
        $this->addSql("ALTER TABLE c_forum_forum ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
361
362
        $this->addSql("ALTER TABLE c_forum_post MODIFY COLUMN post_id int unsigned NOT NULL");
363
        $this->addSql("ALTER TABLE c_forum_post DROP PRIMARY KEY");
364
        $this->addSql("ALTER TABLE c_forum_post MODIFY COLUMN post_id int unsigned DEFAULT NULL");
365
        $this->addSql("ALTER TABLE c_forum_post MODIFY COLUMN c_id INT NOT NULL");
366
        $this->addSql("ALTER TABLE c_forum_post ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
367
368
        $this->addSql("ALTER TABLE c_forum_thread MODIFY COLUMN thread_id int unsigned NOT NULL");
369
        $this->addSql("ALTER TABLE c_forum_thread DROP PRIMARY KEY");
370
        $this->addSql("ALTER TABLE c_forum_thread MODIFY COLUMN forum_id int unsigned DEFAULT NULL");
371
        $this->addSql("ALTER TABLE c_forum_thread MODIFY COLUMN c_id INT NOT NULL");
372
        $this->addSql("ALTER TABLE c_forum_thread MODIFY COLUMN thread_id int unsigned DEFAULT NULL");
373
        $this->addSql("ALTER TABLE c_forum_thread ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
374
375
        $this->addSql("ALTER TABLE c_forum_thread ADD COLUMN thread_peer_qualify tinyint default 0");
376
377
        $this->addSql("ALTER TABLE c_glossary MODIFY COLUMN glossary_id int unsigned NOT NULL");
378
        $this->addSql("ALTER TABLE c_glossary MODIFY COLUMN c_id INT NOT NULL");
379
        $this->addSql("ALTER TABLE c_glossary DROP PRIMARY KEY");
380
        $this->addSql("ALTER TABLE c_glossary MODIFY COLUMN glossary_id int unsigned DEFAULT NULL");
381
        $this->addSql("ALTER TABLE c_glossary ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
382
383
        $this->addSql("ALTER TABLE c_notebook MODIFY COLUMN notebook_id int unsigned NOT NULL");
384
        $this->addSql("ALTER TABLE c_notebook MODIFY COLUMN c_id INT NOT NULL");
385
        $this->addSql("ALTER TABLE c_notebook DROP PRIMARY KEY");
386
        $this->addSql("ALTER TABLE c_notebook MODIFY COLUMN notebook_id int unsigned DEFAULT NULL");
387
        $this->addSql("ALTER TABLE c_notebook ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
388
389
        $this->addSql("ALTER TABLE c_online_connected MODIFY COLUMN c_id INT NOT NULL");
390
        $this->addSql("ALTER TABLE c_online_connected DROP PRIMARY KEY");
391
        $this->addSql("ALTER TABLE c_online_connected ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
392
393
        // For some reason c_tool_intro.id is a varchar in 1.9.x
394
        $this->addSql("ALTER TABLE c_tool_intro MODIFY COLUMN id VARCHAR(50) NOT NULL");
395
        $this->addSql("ALTER TABLE c_tool_intro MODIFY COLUMN c_id INT NOT NULL");
396
        $this->addSql("ALTER TABLE c_tool_intro MODIFY COLUMN session_id int unsigned NOT NULL");
397
        $this->addSql("ALTER TABLE c_tool_intro DROP PRIMARY KEY");
398
        $this->addSql("ALTER TABLE c_tool_intro MODIFY COLUMN session_id int unsigned DEFAULT NULL");
399
        $this->addSql("ALTER TABLE c_tool_intro ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
400
401
        $this->addSql("ALTER TABLE c_quiz_answer MODIFY COLUMN c_id INT NOT NULL");
402
        $this->addSql("ALTER TABLE c_quiz_answer MODIFY COLUMN id_auto int unsigned NOT NULL");
403
        $this->addSql("ALTER TABLE c_quiz_answer DROP PRIMARY KEY");
404
        $this->addSql("ALTER TABLE c_quiz_answer MODIFY COLUMN id_auto int unsigned DEFAULT NULL");
405
        $this->addSql("ALTER TABLE c_quiz_answer ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
406
407
        $this->addSql("ALTER TABLE c_quiz_question_rel_category MODIFY COLUMN c_id INT NOT NULL");
408
        $this->addSql("ALTER TABLE c_quiz_question_rel_category MODIFY COLUMN question_id int unsigned NOT NULL");
409
        $this->addSql("ALTER TABLE c_quiz_question_rel_category DROP PRIMARY KEY");
410
        $this->addSql("ALTER TABLE c_quiz_question_rel_category MODIFY COLUMN question_id int unsigned DEFAULT NULL");
411
        $this->addSql("ALTER TABLE c_quiz_question_rel_category ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
412
413
        $this->addSql("ALTER TABLE session_rel_user MODIFY COLUMN id_session int");
414
        $this->addSql("ALTER TABLE session_rel_user MODIFY COLUMN id_user int");
415
        $this->addSql("ALTER TABLE session_rel_user MODIFY COLUMN relation_type int unsigned DEFAULT 0");
416
        $this->addSql("ALTER TABLE session_rel_user DROP PRIMARY KEY");
417
418
        $this->addSql("ALTER TABLE session_rel_user CHANGE id_session session_id int");
419
        $this->addSql("ALTER TABLE session_rel_user CHANGE id_user user_id int");
420
        $this->addSql("ALTER TABLE session_rel_user ADD COLUMN id int NOT NULL PRIMARY KEY AUTO_INCREMENT");
421
422
        $this->addSql("ALTER TABLE c_item_property CHANGE id_session session_id int");
423
        $this->addSql("ALTER TABLE course_rel_user CHANGE tutor_id is_tutor int");
424
425
        $this->addSql("ALTER TABLE c_quiz_rel_question MODIFY COLUMN c_id INT NOT NULL");
426
        $this->addSql("ALTER TABLE c_quiz_rel_question DROP PRIMARY KEY");
427
        $this->addSql("ALTER TABLE c_quiz_rel_question MODIFY COLUMN question_id int unsigned DEFAULT NULL");
428
        $this->addSql("ALTER TABLE c_quiz_rel_question MODIFY COLUMN exercice_id int unsigned DEFAULT NULL");
429
        $this->addSql("ALTER TABLE c_quiz_rel_question ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
430
431
        $this->addSql("ALTER TABLE c_role MODIFY COLUMN role_id int unsigned NOT NULL");
432
        $this->addSql("ALTER TABLE c_role MODIFY COLUMN c_id INT NOT NULL");
433
        $this->addSql("ALTER TABLE c_role DROP PRIMARY KEY");
434
        $this->addSql("ALTER TABLE c_role MODIFY COLUMN role_id int unsigned DEFAULT NULL");
435
        $this->addSql("ALTER TABLE c_role ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
436
437
        $this->addSql("ALTER TABLE c_role_user DROP PRIMARY KEY");
438
        $this->addSql("ALTER TABLE c_role_user MODIFY COLUMN role_id int unsigned DEFAULT NULL");
439
        $this->addSql("ALTER TABLE c_role_user MODIFY COLUMN user_id int unsigned DEFAULT NULL");
440
        $this->addSql("ALTER TABLE c_role_user MODIFY COLUMN c_id INT NOT NULL");
441
        $this->addSql("ALTER TABLE c_role_user ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
442
443
        $this->addSql("ALTER TABLE c_survey MODIFY COLUMN survey_id int NOT NULL");
444
        $this->addSql("ALTER TABLE c_survey MODIFY COLUMN c_id INT NOT NULL");
445
        $this->addSql("ALTER TABLE c_survey DROP PRIMARY KEY");
446
        $this->addSql("ALTER TABLE c_survey MODIFY COLUMN survey_id int NULL");
447
        $this->addSql("ALTER TABLE c_survey ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
448
449
        $this->addSql("ALTER TABLE c_survey_answer MODIFY COLUMN answer_id int unsigned NOT NULL");
450
        $this->addSql("ALTER TABLE c_survey_answer MODIFY COLUMN c_id INT NOT NULL");
451
        $this->addSql("ALTER TABLE c_survey_answer DROP PRIMARY KEY");
452
        $this->addSql("ALTER TABLE c_survey_answer MODIFY COLUMN answer_id int unsigned DEFAULT NULL");
453
        $this->addSql("ALTER TABLE c_survey_answer ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
454
455
        $this->addSql("ALTER TABLE c_survey_invitation MODIFY COLUMN survey_invitation_id int unsigned NOT NULL");
456
        $this->addSql("ALTER TABLE c_survey_invitation MODIFY COLUMN c_id INT NOT NULL");
457
        $this->addSql("ALTER TABLE c_survey_invitation DROP PRIMARY KEY");
458
        $this->addSql("ALTER TABLE c_survey_invitation MODIFY COLUMN survey_invitation_id int unsigned DEFAULT NULL");
459
        $this->addSql("ALTER TABLE c_survey_invitation ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
460
461
        $this->addSql("ALTER TABLE c_survey_question MODIFY COLUMN question_id int unsigned NOT NULL");
462
        $this->addSql("ALTER TABLE c_survey_question MODIFY COLUMN c_id INT NOT NULL");
463
        $this->addSql("ALTER TABLE c_survey_question DROP PRIMARY KEY");
464
        $this->addSql("ALTER TABLE c_survey_question MODIFY COLUMN question_id int unsigned DEFAULT NULL");
465
        $this->addSql("ALTER TABLE c_survey_question ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
466
467
        $this->addSql("ALTER TABLE c_survey_question_option MODIFY COLUMN question_option_id int unsigned NOT NULL");
468
        $this->addSql("ALTER TABLE c_survey_question_option MODIFY COLUMN c_id INT NOT NULL");
469
        $this->addSql("ALTER TABLE c_survey_question_option DROP PRIMARY KEY");
470
        $this->addSql("ALTER TABLE c_survey_question_option MODIFY COLUMN question_option_id int unsigned DEFAULT NULL");
471
        $this->addSql("ALTER TABLE c_survey_question_option ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
472
473
        $this->addSql("ALTER TABLE c_wiki_conf DROP PRIMARY KEY");
474
        $this->addSql("ALTER TABLE c_wiki_conf MODIFY COLUMN page_id int unsigned DEFAULT NULL");
475
        $this->addSql("ALTER TABLE c_wiki_conf MODIFY COLUMN c_id INT NOT NULL");
476
        $this->addSql("ALTER TABLE c_wiki_conf ADD COLUMN iid int NOT NULL PRIMARY KEY AUTO_INCREMENT");
477
478
        // Course
479
        $this->addSql("ALTER TABLE c_survey ADD COLUMN visible_results INT UNSIGNED DEFAULT 0");
480
        $this->addSql("ALTER TABLE c_survey_invitation ADD COLUMN group_id INT NOT NULL");
481
        $this->addSql("ALTER TABLE c_lp_item ADD COLUMN prerequisite_min_score float");
482
        $this->addSql("ALTER TABLE c_lp_item ADD COLUMN prerequisite_max_score float");
483
        $this->addSql("ALTER TABLE c_group_info ADD COLUMN status tinyint DEFAULT 1");
484
        $this->addSql("ALTER TABLE c_student_publication ADD COLUMN document_id int DEFAULT 0");
485
        $this->addSql("ALTER TABLE c_lp_item MODIFY COLUMN description VARCHAR(511) DEFAULT ''");
486
        $this->addSql("ALTER TABLE course_category MODIFY COLUMN auth_course_child VARCHAR(40) DEFAULT 'TRUE' ");
487
        $this->addSql("ALTER TABLE course_category MODIFY COLUMN auth_cat_child VARCHAR(40) DEFAULT 'TRUE'");
488
        $this->addSql("ALTER TABLE c_quiz_answer MODIFY COLUMN hotspot_type varchar(40) default NULL");
489
        $this->addSql("ALTER TABLE c_tool MODIFY COLUMN target varchar(20) NOT NULL default '_self' ");
490
        $this->addSql("ALTER TABLE c_link MODIFY COLUMN on_homepage char(10) NOT NULL default '0' ");
491
        $this->addSql("ALTER TABLE c_blog_rating MODIFY COLUMN rating_type char(40) NOT NULL default 'post' ");
492
        $this->addSql("ALTER TABLE c_survey MODIFY COLUMN anonymous char(10) NOT NULL default '0'");
493
        $this->addSql("ALTER TABLE c_course_setting MODIFY COLUMN value varchar(255) default ''");
494
495
        $this->addSql("UPDATE course_field SET field_type = 13 WHERE field_variable = 'special_course'");
496
        $this->addSql("UPDATE user SET registration_date = NULL WHERE registration_date = '0000-00-00 00:00:00'");
497
        $this->addSql("UPDATE user SET expiration_date = NULL WHERE expiration_date = '0000-00-00 00:00:00'");
498
        $this->addSql("UPDATE track_e_default SET default_date = NULL WHERE default_date = '0000-00-00 00:00:00'");
499
        $this->addSql("UPDATE track_e_lastaccess SET access_date = NULL WHERE access_date = '0000-00-00 00:00:00'");
500
        $this->addSql("UPDATE track_e_downloads SET down_date = NULL WHERE down_date = '0000-00-00 00:00:00'");
501
        $this->addSql("UPDATE track_e_access SET access_date = NULL WHERE access_date = '0000-00-00 00:00:00'");
502
        $this->addSql("UPDATE track_e_access SET c_id = (SELECT id FROM course WHERE code = access_cours_code)");
503
        $this->addSql("UPDATE track_e_default SET c_id = (SELECT id FROM course WHERE code = default_cours_code)");
504
        $this->addSql("UPDATE track_e_lastaccess SET c_id = (SELECT id FROM course WHERE code = access_cours_code)");
505
        $this->addSql("UPDATE track_e_exercices SET c_id = (SELECT id FROM course WHERE code = exe_cours_id)");
506
        $this->addSql("UPDATE track_e_downloads SET c_id = (SELECT id FROM course WHERE code = down_cours_id)");
507
        $this->addSql("UPDATE track_e_hotpotatoes SET c_id = (SELECT id FROM course WHERE code = exe_cours_id)");
508
        $this->addSql("UPDATE track_e_links SET c_id = (SELECT id FROM course WHERE code = links_cours_id)");
509
        $this->addSql("UPDATE track_e_course_access SET c_id = (SELECT id FROM course WHERE code = course_code)");
510
        $this->addSql("UPDATE track_e_online SET c_id = (SELECT id FROM course WHERE code = course)");
511
        $this->addSql("UPDATE track_e_attempt SET c_id = (SELECT id FROM course WHERE code = course_code)");
512
        $this->addSql("UPDATE course_field_values SET c_id = (SELECT id FROM course WHERE code = course_code)");
513
        $this->addSql("UPDATE session_rel_course_rel_user SET c_id = (SELECT id FROM course WHERE code = course_code)");
514
        $this->addSql("UPDATE session_rel_course SET c_id = (SELECT id FROM course WHERE code = course_code)");
515
516
        $this->addSql("UPDATE access_url_rel_course SET c_id = (SELECT id FROM course WHERE code = course_code)");
517
518
        $this->addSql("ALTER TABLE settings_current DROP INDEX unique_setting");
519
        $this->addSql("ALTER TABLE settings_options DROP INDEX unique_setting_option");
520
521
        $this->addSql("DELETE FROM settings_current WHERE variable = 'wcag_anysurfer_public_pages'");
522
523
        $this->addSql("DELETE FROM settings_current WHERE variable = 'wcag_anysurfer_public_pages'");
524
        $this->addSql("DELETE FROM settings_options WHERE variable = 'wcag_anysurfer_public_pages'");
525
        $this->addSql("DELETE FROM settings_current WHERE variable = 'advanced_filemanager'");
526
        $this->addSql("DELETE FROM settings_options WHERE variable = 'advanced_filemanager'");
527
528
        $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('institution_address', NULL, 'textfield', 'Platform', '', 'InstitutionAddressTitle', 'InstitutionAddressComment', NULL, NULL, 1)");
529
        $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('prevent_session_admins_to_manage_all_users', NULL, 'radio', 'Session', 'false', 'PreventSessionAdminsToManageAllUsersTitle', 'PreventSessionAdminsToManageAllUsersComment', NULL, NULL, 1)");
530
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('prevent_session_admins_to_manage_all_users', 'true', 'Yes'), ('prevent_session_admins_to_manage_all_users', 'false', 'No')");
531
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'none', 'None')");
532
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'exercise', 'Exercise')");
533
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'lp', 'Learning path')");
534
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'exercise_and_lp', 'ExerciseAndLearningPath')");
535
        $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('documents_default_visibility_defined_in_course', NULL,'radio','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1)");
536
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('documents_default_visibility_defined_in_course', 'true', 'Yes')");
537
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('documents_default_visibility_defined_in_course', 'false', 'No')");
538
        $this->addSql("INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('enabled_mathjax', NULL, 'radio', 'Editor', 'false', 'EnableMathJaxTitle', 'EnableMathJaxComment', NULL, NULL, 0)");
539
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_mathjax', 'true', 'Yes')");
540
        $this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_mathjax', 'false', 'No')");
541
542
        $this->addSql("INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available) VALUES ('Føroyskt', 'faroese', 'fo', 'faroese', 0), ('Tagalog', 'tagalog', 'tl', 'tagalog',1), ('Tibetan', 'tibetan', 'bo', 'tibetan', 0), ('isiXhosa', 'xhosa', 'xh', 'xhosa', 0)");
543
        $this->addSql("DELETE FROM settings_options WHERE variable = 'show_glossary_in_extra_tools'");
544
545
        $this->addSql("ALTER TABLE c_student_publication MODIFY COLUMN date_of_qualification DATETIME NULL DEFAULT NULL");
546
        $this->addSql("ALTER TABLE c_student_publication MODIFY COLUMN sent_date DATETIME NULL DEFAULT NULL");
547
        $this->addSql("UPDATE c_student_publication SET date_of_qualification = NULL WHERE date_of_qualification = '0000-00-00 00:00:00'");
548
        $this->addSql("UPDATE c_student_publication SET sent_date = NULL WHERE sent_date = '0000-00-00 00:00:00'");
549
550
        $this->addSql("ALTER TABLE c_student_publication_assignment MODIFY COLUMN expires_on DATETIME NULL DEFAULT NULL");
551
        $this->addSql("ALTER TABLE c_student_publication_assignment MODIFY COLUMN ends_on DATETIME NULL DEFAULT NULL");
552
        $this->addSql("UPDATE c_student_publication_assignment SET expires_on = NULL WHERE expires_on = '0000-00-00 00:00:00'");
553
        $this->addSql("UPDATE c_student_publication_assignment SET ends_on = NULL WHERE ends_on = '0000-00-00 00:00:00'");
554
555
        $this->addSql("UPDATE settings_current SET type = 'checkbox' WHERE variable = 'registration' AND category = 'User'");
556
557
        $this->addSql("UPDATE settings_current SET selected_value = 'UTF-8' WHERE variable = 'platform_charset'");
558
559
        $this->addSql("ALTER TABLE course_rel_user DROP PRIMARY KEY");
560
        $this->addSql("ALTER TABLE course_rel_user ADD COLUMN id INT NOT NULL PRIMARY KEY AUTO_INCREMENT");
561
        $this->addSql("ALTER TABLE course_rel_user MODIFY COLUMN user_id INT NULL");
562
563
        $this->addSql("ALTER TABLE user MODIFY COLUMN user_id INT NULL");
564
565
        $this->addSql("ALTER TABLE access_url_rel_course DROP PRIMARY KEY");
566
        $this->addSql("ALTER TABLE access_url_rel_course ADD COLUMN id INT NOT NULL PRIMARY KEY AUTO_INCREMENT");
567
        $this->addSql("ALTER TABLE access_url_rel_course DROP COLUMN course_code");
568
        $this->addSql("ALTER TABLE access_url_rel_course ADD INDEX idx_select_c (c_id)");
569
        $this->addSql("ALTER TABLE access_url_rel_course ADD INDEX idx_select_u (access_url_id)");
570
571
        $this->addSql("ALTER TABLE access_url ADD COLUMN url_type TINYINT(1) NULL");
572
573
        $this->addSql("ALTER TABLE course_rel_user ADD INDEX idx_select_c (c_id)");
574
575
        $this->addSql("ALTER TABLE track_e_uploads ADD COLUMN c_id INT NOT NULL");
576
        $this->addSql("UPDATE track_e_uploads SET c_id = (SELECT id FROM course WHERE code = upload_cours_id)");
577
578
        //postUp
579
        $this->addSql("ALTER TABLE track_e_access DROP COLUMN access_cours_code");
580
        $this->addSql("ALTER TABLE track_e_default DROP COLUMN default_cours_code");
581
        $this->addSql("ALTER TABLE track_e_lastaccess DROP COLUMN access_cours_code");
582
        $this->addSql("ALTER TABLE track_e_exercices DROP COLUMN exe_cours_id");
583
        $this->addSql("ALTER TABLE track_e_downloads DROP COLUMN down_cours_id");
584
        $this->addSql("ALTER TABLE track_e_hotpotatoes DROP COLUMN exe_cours_id");
585
        $this->addSql("ALTER TABLE track_e_links DROP COLUMN links_cours_id");
586
        $this->addSql("ALTER TABLE track_e_course_access DROP COLUMN course_code");
587
        $this->addSql("ALTER TABLE track_e_online DROP COLUMN course");
588
        $this->addSql("ALTER TABLE track_e_attempt DROP COLUMN course_code");
589
590
        $this->addSql("ALTER TABLE course_rel_user DROP COLUMN group_id");
591
        $this->addSql("ALTER TABLE course_rel_user DROP COLUMN role");
592
593
        $this->addSql("DROP TABLE track_c_countries");
594
        $this->addSql("DROP TABLE track_c_browsers");
595
        $this->addSql("DROP TABLE track_c_os");
596
        $this->addSql("DROP TABLE track_c_providers");
597
        $this->addSql("DROP TABLE track_c_referers");
598
    }
599
600
    /**
601
     * We don't allow downgrades yet
602
     * @param Schema $schema
603
     */
604
    public function down(Schema $schema)
605
    {
606
    }
607
}
608