blob: 0407024dcb548c2c33b5fb23a86aa272d4f7d13a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<?php
/**
* some database tweaking
*
* @author André Noack <noack@data-quest.de>
* @license GPL2 or any later version
*/
class Tic6025Performance extends Migration
{
public function description()
{
return _('Performance Tweaks');
}
public function up()
{
$this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (html_id)");
$this->tryExecute("ALTER TABLE personal_notifications ADD INDEX (url(256))");
$this->tryExecute("ALTER TABLE admission_seminar_user CHANGE status status ENUM('awaiting','accepted') NOT NULL");
$this->tryExecute("ALTER TABLE ex_termine DROP INDEX autor_id");
$this->tryExecute("ALTER TABLE ex_termine ADD INDEX (date)");
$this->tryExecute("ALTER TABLE termine ADD INDEX (date)");
$this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX `unique`");
$this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX termin_id");
$this->tryExecute("ALTER TABLE termin_related_groups DROP INDEX statusgruppe_id");
$this->tryExecute("ALTER TABLE termin_related_groups CHANGE statusgruppe_id statusgruppe_id VARCHAR(32) NOT NULL");
$this->tryExecute("ALTER TABLE termin_related_groups ADD PRIMARY KEY( termin_id, statusgruppe_id)");
$this->tryExecute("ALTER TABLE `user_config` ADD INDEX (`field`, `value`(10))");
}
private function tryExecute($sql)
{
try {
DBManager::get()->exec($sql);
} catch (PDOException $e) {
$this->announce("sql failed: %s", $sql);
}
}
}
|