-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSetup.php
More file actions
66 lines (54 loc) · 1.69 KB
/
Setup.php
File metadata and controls
66 lines (54 loc) · 1.69 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
56
57
58
59
60
61
62
63
64
65
66
<?php
namespace ThemeHouse\NoticesPlus;
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\NoticesPlus
*/
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
/**
*
*/
public function installStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_notice', function (Alter $table) {
$table->addColumn('thnoticesplus_overlay_dismissible', 'boolean')->setDefault(1);
});
}
/**
*
*/
public function uninstallStep1()
{
$schemaManager = $this->schemaManager();
$schemaManager->alterTable('xf_notice', function (Alter $table) {
$table->dropColumns(['thnoticesplus_overlay_dismissible']);
});
}
/**
*
*/
public function uninstallStep2()
{
$this->db()->update('xf_notice', [ 'notice_type' => 'block' ], 'notice_type = ?', 'thnoticesplus_overlay');
$this->db()->update('xf_notice', [ 'notice_type' => 'block' ], 'notice_type = ?', 'thnoticesplus_overlay');
}
/**
*
*/
public function uninstallStep3()
{
$this->db()->update('xf_notice', [ 'display_style' => 'primary' ], 'display_style = ?', 'thnoticesplus_success');
$this->db()->update('xf_notice', [ 'display_style' => 'primary' ], 'display_style = ?', 'thnoticesplus_warning');
$this->db()->update('xf_notice', [ 'display_style' => 'primary' ], 'display_style = ?', 'thnoticesplus_error');
}
}