forked from luutruong/XF2_Censorship
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup.php
More file actions
32 lines (27 loc) · 780 Bytes
/
Setup.php
File metadata and controls
32 lines (27 loc) · 780 Bytes
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
<?php
namespace Truonglv\Censorship;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\AddOn\StepRunnerUninstallTrait;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
public function installStep1()
{
try {
$this->query("ALTER TABLE xf_user_option
ADD COLUMN tl_censorship_enabled TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'");
} catch (\XF\Db\Exception $e) {
}
}
public function uninstallStep1()
{
try {
$this->query('ALTER TABLE xf_user_option DROP COLUMN tl_censorship_enabled');
} catch (\XF\Db\Exception $e) {
}
}
}