-
Notifications
You must be signed in to change notification settings - Fork 1
/
Setup.php
42 lines (36 loc) · 1.01 KB
/
Setup.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
<?php
namespace nick97\BetterLogout;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
public function installStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_user', function (\XF\Db\Schema\Alter $table) {
$table->addColumn('xm_bl_logout_type', 'int')->setDefault(0);
});
}
/**
* Uninstall Functions
*/
public function uninstallStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_user', function (\XF\Db\Schema\Alter $table) {
$table->dropColumns(['xm_bl_logout_type']);
});
}
public function upgrade2020091Step1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_user', function (\XF\Db\Schema\Alter $table) {
$table->renameColumn('logout_options', 'xm_bl_logout_type');
});
}
}