-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
m150714_100355_cleanup.php
50 lines (41 loc) · 2.42 KB
/
m150714_100355_cleanup.php
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
47
48
49
50
<?php
use yii\db\Migration;
class m150714_100355_cleanup extends Migration
{
public function up()
{
$this->dropColumn('notification', 'obsolete_target_object_model');
$this->dropColumn('notification', 'obsolete_target_object_id');
$this->dropColumn('notification', 'created_by');
$this->dropColumn('notification', 'updated_by');
$this->dropColumn('notification', 'updated_at');
$this->addColumn('notification', 'module', "varchar(100) DEFAULT ''");
$this->update('notification', ['module' => 'admin'], ['class' => 'humhub\modules\admin\notifications\NewVersionAvailable']);
$this->update('notification', ['module' => 'comment'], ['class' => 'humhub\modules\comment\notifications\NewComment']);
$this->update('notification', ['module' => 'content'], ['class' => 'humhub\modules\content\notifications\ContentCreated']);
$this->update('notification', ['module' => 'like'], ['class' => 'humhub\modules\like\notifications\NewLike']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\NewLike']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\ApprovalRequest']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\ApprovalRequestAccepted']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\ApprovalRequestDeclined']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\Invite']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\InviteAccepted']);
$this->update('notification', ['module' => 'space'], ['class' => 'humhub\modules\space\notifications\InviteDeclined']);
$this->update('notification', ['module' => 'user'], ['class' => 'humhub\modules\user\notifications\Followed']);
$this->update('notification', ['module' => 'user'], ['class' => 'humhub\modules\user\notifications\Mentioned']);
}
public function down()
{
echo "m150714_100355_cleanup cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}