-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSetup.php
57 lines (50 loc) · 1.55 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace ThemeHouse\ActivationReminderPurger;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Create;
/**
* Class Setup
* @package ThemeHouse\ActivationReminderPurger
*/
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
/**
*
*/
public function installStep1()
{
$this->schemaManager()->createTable('xf_th_arp_activation_reminder', function (Create $table) {
$table->addColumn('user_id', 'int');
$table->addColumn('send_date', 'int')->setDefault(0);
$table->addPrimaryKey('user_id');
});
}
public function postInstall(array &$stateChanges)
{
\XF::app()->jobManager()->enqueueUnique('thARP_activationReminderEmail',
'ThemeHouse\ActivationReminderPurger:UserPurger');
}
public function upgrade1000091Step1()
{
if (!$this->schemaManager()->tableExists('xf_th_arp_activation_reminder')) {
$this->schemaManager()->createTable('xf_th_arp_activation_reminder', function (Create $table) {
$table->addColumn('user_id', 'int');
$table->addColumn('send_date', 'int')->setDefault(0);
$table->addPrimaryKey('user_id');
});
}
}
/**
*
*/
public function uninstallStep1()
{
$this->schemaManager()->dropTable('xf_th_arp_activation_reminder');
}
}