-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSetup.php
More file actions
55 lines (47 loc) · 1.17 KB
/
Setup.php
File metadata and controls
55 lines (47 loc) · 1.17 KB
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
51
52
53
54
55
<?php
namespace ThemeHouse\StaffTracker;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Alter;
/**
* Class Setup
* @package ThemeHouse\StaffTracker
*/
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
/**
*
*/
public function installStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_thread', function (Alter $table) {
$table->addColumn('thstafftracker_staff_post_count', 'int')
->setDefault(0);
});
}
/**
* @param array $stateChanges
*/
public function postInstall(array &$stateChanges)
{
$this->app->jobManager()->enqueue('XF:Thread');
}
/**
*
*/
public function uninstallStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_thread', function (Alter $table) {
$table->dropColumns([
'thstafftracker_staff_post_count',
]);
});
}
}